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