473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sharing classes

Hi All,

This is a very simple question. I have a proxy class (for web service)
and couple of other classes that are common for 3 of my projects. As a
developer, I would like to keep these common classes seperatly and use
them in three different projects. How can I do that?

Thanks.

Nov 17 '05 #1
4 1571
<db*****@gmail.com> wrote:
This is a very simple question. I have a proxy class (for web service)
and couple of other classes that are common for 3 of my projects. As a
developer, I would like to keep these common classes seperatly and use
them in three different projects. How can I do that?


Create a class library project, put the common classes in that, and
then reference that project (or the DLL it produces if you want it in a
different solution) from the projects which need to use it.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2
You can create a link to the file and have the file in a common place, you
do this when you do in Visual studio, Add Existing Item... dialog, see the
add button, the button have an arroy in the rigth, click the arroy and
select Link, the file that have the link will be in the shared location, and
you can edit the file from the 3 projects.

Regards,

Bela Istok

<db*****@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi All,

This is a very simple question. I have a proxy class (for web service)
and couple of other classes that are common for 3 of my projects. As a
developer, I would like to keep these common classes seperatly and use
them in three different projects. How can I do that?

Thanks.

Nov 17 '05 #3
This is fine if the types in these shared classes are not passed across
the web service boundary. If they are, then you are going to have problems
with the Xml Serializer, most likely, and modifying the proxy to use the
shared classes.

The easy way to get around it (although tedious), would be to refactor
the classes passed across the web service boundary into interfaces. Then,
in the proxy on the client side, have the proxy class generated by the WSDL
implement the interface, exposing the properties/fields for the class.
Then, you can have your routines work on implementations of the interface.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
<db*****@gmail.com> wrote:
This is a very simple question. I have a proxy class (for web service)
and couple of other classes that are common for 3 of my projects. As a
developer, I would like to keep these common classes seperatly and use
them in three different projects. How can I do that?


Create a class library project, put the common classes in that, and
then reference that project (or the DLL it produces if you want it in a
different solution) from the projects which need to use it.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 17 '05 #4
I could be wrong.. but it sounds like you are wanting something like a BLL
(Buisiness logic layer) or a DAL(Data access layer). It really depends on
what your classes do. You can search the internet for examples of NTier
applications and you should see several good ones.

Either of the 2 layers I mentioned would basically become a DLL that is
accessible to all of your applications however, following the NTier model
can and usually will cause perforance hits in an application...

<db*****@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi All,

This is a very simple question. I have a proxy class (for web service)
and couple of other classes that are common for 3 of my projects. As a
developer, I would like to keep these common classes seperatly and use
them in three different projects. How can I do that?

Thanks.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phl | last post by:
Hi, I have a console application and a web server which uses the same classes as the console application. Is there some way of sharing variables in these classes so that both the console app and...
42
by: Dan | last post by:
Hello, I have trouble with class calling. I am calling getvolume() with succes in the function CreateCircle but it do not want to call it in ShowCircle() function. I am staying in the same...
5
by: cybertof | last post by:
Hi ! What is the common use of sharing a single .cs across multiple project files ? I think it's to share common classes between projects. I have actually a .cs file shared accross multiple...
3
by: Robert W. | last post by:
I'm embarking on a project that will have both a desktop application and a Pocket PC application. It seems logical to have as much code as possible sitting in a shared project, which would be...
0
by: rcolby | last post by:
Hi, A little advice on code sharing across projects, namespaces and dll's for references. I've got an application that is split between three different projects (one for a service, one for...
4
by: Martin Ehrlich | last post by:
Hello NG. I've got a little problem with sharing types between webservices and clients. I've created a business class with public fields within a shared assembly like: public class Item {
1
by: Joe | last post by:
While I understand that Server Side Includes still work, I realize it's not the best practice for sharing code such as a common set of includes between screens. In ASP.NET I've already built...
8
by: mc | last post by:
I would like to be able to send from an ASP.NET page an email which when recieved takes the form of a "Sharing Invitation for a RSS Feed"...
2
by: Jeff Dege | last post by:
I'm working with a group that's been doing C++ coding for quite a long time, now, and in that environment we've pretty much worked out development practices that serve us well. We've been doing...
45
by: =?Utf-8?B?QmV0aA==?= | last post by:
Hello. I'm trying to find another way to share an instance of an object with other classes. I started by passing the instance to the other class's constructor, like this: Friend Class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.