By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,474 Members | 966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,474 IT Pros & Developers. It's quick & easy.

Sharing Code/Classes Across Projects and Applications

P: n/a
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
ApplicationNamspace.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 ActiveDirectoryUser

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, ActiveDirectoryUser 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, ActiveDirectoryUser 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 ApplicationNamspace.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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.