PC Review


Reply
Thread Tools Rate Thread

Basic architecture question

 
 
mrpubnight@hotmail.com
Guest
Posts: n/a
 
      21st Jan 2005
I was hoping someone with some experience can help me. I'm rather new
to .Net and OO programming. I'm trying to create an object model for a
project I'm working on and I'm somewhat confused how to go about
creating this using VS.Net.


I want to create a class structure that resembles the following - this
does not reflect the actual names, they are just for example:


Projects
Projects.Internal
Projects.Internal.Accounting
Projects.External.Extranet


Each of those items above should be separate classes however I would
like them all to compile into one .dll.


Currently in VS.Net, I've created one solution and then added each of
the above as a different project. This has left me with 4 separate
..dlls.


I would like to mimic something like System.Data where you load the
System.Data.dll library but with that you get SQLClient, etc...
Clearly SQLClient could have been compiled into it's own dll but it
resides within System.Data.dll.

Would it involve creating a base class, Projects, and then each
subsequent class inherits from that class, i.e. Internal, External.
Then Accounting and Extranet would inherit from these inherited classes
(Internal, External respectively). What if there is nothing to really
inherit? I'd like to use this type of namespace in hopes to keep
things organized and I'd like to have everything compile into a single
..dll. Like I said, I can create the schema I want by creating multiple
projects using the same naming convention and thus my namespace will be
defined a certain way but I don't feel that this is the 'correct'
manner in which to do things.
Can any point my in the right direction.

Thanks,
Frank

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGFuIEtlbGxleQ==?=
Guest
Posts: n/a
 
      21st Jan 2005
Each of the classes within a project can have their own namespace. This is
how it is achieved in the SYstem.Data example you provided.

Don't use inheritance if there is no shared logic or relationship between
your objects.

HTH
Dan

"(E-Mail Removed)" wrote:

> I was hoping someone with some experience can help me. I'm rather new
> to .Net and OO programming. I'm trying to create an object model for a
> project I'm working on and I'm somewhat confused how to go about
> creating this using VS.Net.
>
>
> I want to create a class structure that resembles the following - this
> does not reflect the actual names, they are just for example:
>
>
> Projects
> Projects.Internal
> Projects.Internal.Accounting
> Projects.External.Extranet
>
>
> Each of those items above should be separate classes however I would
> like them all to compile into one .dll.
>
>
> Currently in VS.Net, I've created one solution and then added each of
> the above as a different project. This has left me with 4 separate
> ..dlls.
>
>
> I would like to mimic something like System.Data where you load the
> System.Data.dll library but with that you get SQLClient, etc...
> Clearly SQLClient could have been compiled into it's own dll but it
> resides within System.Data.dll.
>
> Would it involve creating a base class, Projects, and then each
> subsequent class inherits from that class, i.e. Internal, External.
> Then Accounting and Extranet would inherit from these inherited classes
> (Internal, External respectively). What if there is nothing to really
> inherit? I'd like to use this type of namespace in hopes to keep
> things organized and I'd like to have everything compile into a single
> ..dll. Like I said, I can create the schema I want by creating multiple
> projects using the same naming convention and thus my namespace will be
> defined a certain way but I don't feel that this is the 'correct'
> manner in which to do things.
> Can any point my in the right direction.
>
> Thanks,
> Frank
>
>

 
Reply With Quote
 
=?Utf-8?B?bWZkYXRzdzE=?=
Guest
Posts: n/a
 
      21st Jan 2005
Each project in a solution compiles into a separate file. So you want to put
all your classes into one project in order to compile one DLL.

To address the classes with the "." notation you need to nest the classes,
which means putting them all in one file. The following empty class code will
create the name tree that you offered as an example:

Public Class Projects
Public Class Internal
Public Class Accounting
End Class
End Class
Public Class External
Public Class Extranet
End Class
End Class
End Class


"(E-Mail Removed)" wrote:

> I was hoping someone with some experience can help me. I'm rather new
> to .Net and OO programming. I'm trying to create an object model for a
> project I'm working on and I'm somewhat confused how to go about
> creating this using VS.Net.
>
>
> I want to create a class structure that resembles the following - this
> does not reflect the actual names, they are just for example:
>
>
> Projects
> Projects.Internal
> Projects.Internal.Accounting
> Projects.External.Extranet
>
>
> Each of those items above should be separate classes however I would
> like them all to compile into one .dll.
>
>
> Currently in VS.Net, I've created one solution and then added each of
> the above as a different project. This has left me with 4 separate
> ..dlls.
>
>
> I would like to mimic something like System.Data where you load the
> System.Data.dll library but with that you get SQLClient, etc...
> Clearly SQLClient could have been compiled into it's own dll but it
> resides within System.Data.dll.
>
> Would it involve creating a base class, Projects, and then each
> subsequent class inherits from that class, i.e. Internal, External.
> Then Accounting and Extranet would inherit from these inherited classes
> (Internal, External respectively). What if there is nothing to really
> inherit? I'd like to use this type of namespace in hopes to keep
> things organized and I'd like to have everything compile into a single
> ..dll. Like I said, I can create the schema I want by creating multiple
> projects using the same naming convention and thus my namespace will be
> defined a certain way but I don't feel that this is the 'correct'
> manner in which to do things.
> Can any point my in the right direction.
>
> Thanks,
> Frank
>
>

 
Reply With Quote
 
=?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
Guest
Posts: n/a
 
      21st Jan 2005
I think the question here was "how do I set this up easily", which is most
easily accomplished through adding folders to the project.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Dan Kelley" wrote:

> Each of the classes within a project can have their own namespace. This is
> how it is achieved in the SYstem.Data example you provided.
>
> Don't use inheritance if there is no shared logic or relationship between
> your objects.
>
> HTH
> Dan
>
> "(E-Mail Removed)" wrote:
>
> > I was hoping someone with some experience can help me. I'm rather new
> > to .Net and OO programming. I'm trying to create an object model for a
> > project I'm working on and I'm somewhat confused how to go about
> > creating this using VS.Net.
> >
> >
> > I want to create a class structure that resembles the following - this
> > does not reflect the actual names, they are just for example:
> >
> >
> > Projects
> > Projects.Internal
> > Projects.Internal.Accounting
> > Projects.External.Extranet
> >
> >
> > Each of those items above should be separate classes however I would
> > like them all to compile into one .dll.
> >
> >
> > Currently in VS.Net, I've created one solution and then added each of
> > the above as a different project. This has left me with 4 separate
> > ..dlls.
> >
> >
> > I would like to mimic something like System.Data where you load the
> > System.Data.dll library but with that you get SQLClient, etc...
> > Clearly SQLClient could have been compiled into it's own dll but it
> > resides within System.Data.dll.
> >
> > Would it involve creating a base class, Projects, and then each
> > subsequent class inherits from that class, i.e. Internal, External.
> > Then Accounting and Extranet would inherit from these inherited classes
> > (Internal, External respectively). What if there is nothing to really
> > inherit? I'd like to use this type of namespace in hopes to keep
> > things organized and I'd like to have everything compile into a single
> > ..dll. Like I said, I can create the schema I want by creating multiple
> > projects using the same naming convention and thus my namespace will be
> > defined a certain way but I don't feel that this is the 'correct'
> > manner in which to do things.
> > Can any point my in the right direction.
> >
> > Thanks,
> > Frank
> >
> >

 
Reply With Quote
 
=?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
Guest
Posts: n/a
 
      21st Jan 2005
Following what you have written.

1. Create a Project called Projects
2. Create a folder in the project called Internal
3. Create folders in the Internal folder called Accounting and Extranet

When you create a class in the Extranet folder, it will have the namespace:

Projects.Internal.Extranet

There are ways you can dink this up, of course, but that is the default. The
whole will compile in one DLL.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"(E-Mail Removed)" wrote:

> I was hoping someone with some experience can help me. I'm rather new
> to .Net and OO programming. I'm trying to create an object model for a
> project I'm working on and I'm somewhat confused how to go about
> creating this using VS.Net.
>
>
> I want to create a class structure that resembles the following - this
> does not reflect the actual names, they are just for example:
>
>
> Projects
> Projects.Internal
> Projects.Internal.Accounting
> Projects.External.Extranet
>
>
> Each of those items above should be separate classes however I would
> like them all to compile into one .dll.
>
>
> Currently in VS.Net, I've created one solution and then added each of
> the above as a different project. This has left me with 4 separate
> ..dlls.
>
>
> I would like to mimic something like System.Data where you load the
> System.Data.dll library but with that you get SQLClient, etc...
> Clearly SQLClient could have been compiled into it's own dll but it
> resides within System.Data.dll.
>
> Would it involve creating a base class, Projects, and then each
> subsequent class inherits from that class, i.e. Internal, External.
> Then Accounting and Extranet would inherit from these inherited classes
> (Internal, External respectively). What if there is nothing to really
> inherit? I'd like to use this type of namespace in hopes to keep
> things organized and I'd like to have everything compile into a single
> ..dll. Like I said, I can create the schema I want by creating multiple
> projects using the same naming convention and thus my namespace will be
> defined a certain way but I don't feel that this is the 'correct'
> manner in which to do things.
> Can any point my in the right direction.
>
> Thanks,
> Frank
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
basic architecture question RSH Microsoft C# .NET 4 1st Feb 2008 08:41 PM
Basic n-tier architecture question... =?Utf-8?B?SmF5IFdpbGxpYW1z?= Microsoft Dot NET 4 10th Mar 2006 09:16 PM
Basic architecture question mrpubnight@hotmail.com Microsoft Dot NET Framework 0 21st Jan 2005 04:46 AM
Re: Basic architecture question concerning SqlConnection objects Cowboy \(Gregory A. Beamer\) [MVP] Microsoft ADO .NET 2 11th Jun 2004 01:47 PM
Basic Architecture Todd Microsoft VB .NET 5 28th Oct 2003 03:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:12 AM.