473,734 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sharing Code/Classes Across Projects and Applications

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 manual operation of the service and web client for
the interface to the user). There are a lot of functions that are shared
through these projects and I'm using the following format which is store in
ApplicationNams pace.vb and doesn't seem to work right and looking into
namespaces and how to reference across projects.

Namespace ApplicationName

Public Class ActiveDirectory

Functions to interact with active directory
End Class

Public Class SqlDatabase

Functions to insert data into sql database

End class

Class ActiveDirectory User

Private GuidObjectGUID As Byte()
Private strDisplayName As String

Public Property ObjectGUID() As Byte()
Get
Return GuidObjectGUID
End Get

Set(ByVal Value As Byte())
GuidObjectGUID = Value
End Set

End Property

Public Property DisplayName() As String
Get
Return strDisplayName
End Get

Set(ByVal Value As Byte())
Set
GuidObjectGUID = Value
End Set
End Class
End Namespace

Is it better to have a different file for each class e.g.
ActiveDirectory .vb, ActiveDirectory User and SqlDatabase (the class file
could get big and might only use one class from the .vb file in future
projects). The other thing I'm looking at is namespace and each of these
ActiveDirectory , ActiveDirectory User and SqlDatabase would be a namespace in
the same .vb file.

I'm changing these classes as the application is developed, is it acceptable
to insert the ApplicationNams pace.vb into each project I'm going to use the
classes in or should it be compiled to a dll then referenced, what are the
advantages.

I little new to classes and organising code, want to start on the right
foot.

Thanks for your advice in advance.

Cheers
Richard
Nov 21 '05 #1
0 1559

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

Similar topics

1
1949
by: Simon Neve | last post by:
Hello, This question is related to sharing .Net projects across solutions and is reposted from the SourceSafe group. We have several different solutions and want to share common assemblies across them. Is it best to share the project and its files to each solution (each solution has it's own shared project), or have each solution point to the same file location of the project?
5
5377
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 projects in a same solution. It's nice to have a common "set" of Classes. Is this the only way to share classes between projects ?
5
13514
by: Tinius | last post by:
I have created a class which I wish to reuse amongst several projects. But each time I Add the class to a new project, it creates a copy of that class in the folder of the new project. This means that when I make changes to that class, I have to apply the same changes to all the projects. Is there a setting that I have missed such that I can share one class amongst several projects? -- Tinius
1
3659
by: JoeS | last post by:
Is there anyway to share a single pch file between projects in VC 7.0? I have 300+ projects each of which creates its own pch. All projects include the exact same header files in the precompiled header. Its takes about 7 seconds to create the precompiled header for each project. That's 35 minutes spent creating precompiled headers for all project! All of the projects use PDB files for debug info. I tried creating Precomp.pch in project...
5
8533
by: geoffblanduk_nospam | last post by:
Is it valid to share namespaces across projects in C#? For example, I have a project that contains the code for a core assembly, this builds a DLL. I then have a second project in the same solution that contains test cases for the assembly in the same namespace, this references the first project's DLL and builds a further DLL for testing. All code has the same namespace. The code in the tests needs access to internal methods etc of the...
4
1589
by: dbcuser | last post by:
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.
3
2793
by: Shikari Shambu | last post by:
Hi All, I have a situation where multiple applications are sharing some pages/ controls. So, I have a separate common project that has the common pages/ controls. My question is how do I reference these pages/ controls from my ASP.NET web projects WEbApp1 url http://localhost/app1 C:\Apps\App1
2
1972
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 more and more, over the last few years, in C# and ASP.NET. Some web apps, some background services. In our C++ code base, we have a fair number of statically-linked libraries that contain code we share between projects. At this point, in our...
45
3006
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 clsData Private m_objSQLClient As clsSQLClient Private m_objUsers As clsUsers
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9182
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.