Classes and Nested Classes

  • Thread starter Thread starter Raju Joseph
  • Start date Start date
R

Raju Joseph

Hi All,

We are in the process of developing an N-Tier app using VB.NET. We are
extensively using classes (entity objects) in our design. Further, most of
the times, we do have to specify nested types within our entity classes.

For example

Public Class Country
ID as short
Name as string
End Class

Public Class Address
Street as string
City as CITY
State as STATE
Country as COUNTRY
End Class

What I am looking for is : Are there any notes which assists as when
actually to use nested types and when not to. Any design rules that will
help us. Now, our classes, since we heavily use nested classes, is getting
very complex.

Any suggestions or directions would be really appreciated.

Thanks

Raj...
 
We also use custom Entity Objects and Collections for our applications.
One thing to remember is that there is such a thing as too much abstraction.

For instance, do you really need an address object? We chose to implement
one because our BusinessEntities could have more than one address associated
with them. ie. Work address, Home address, Postal Address ect.. So we opted
to make our Address field a collections of address objects with a built in
AddressType enumeration.

Another thing to remember is that when designing your entity objects, they
are not necessairily a direct 1-1 reflection of your datastructure. They
can, and in many cases are, a compiliation of data found in many different
tables.

If you haven't already done so, read the "Application Architecture for .Net:
Designing Applications and Services" paper found on the Microsoft Patterns
and Practices web site. It contains numerous design guides that you may
find helpful.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top