Address Object

Address Object

Old forum URL: forums.lhotka.net/forums/t/4360.aspx


SouthSpawn posted on Saturday, February 16, 2008

Ok,
 
I am trying to create an "Address" object.

I also have the following objects.
 
"Company"
"Contact"
"Customer"
"Employee"
 
Each of these objects will have an "Address" Object attached to them.

I am trying to figure out what would be the proper way to create the "Address" object.
I don't want to make the "Address.NewAddress" factory methods to be a public.

Because in really,  the Address object, even though in a seperate project, will still be a "Child" object itself.
 
Any suggestions?

Thanks,
Mark

robert_m replied on Wednesday, February 20, 2008

Not much you can do if Address is in a different project than the classes that use it. If you can put it in the same project then Address.NewAddress could be declared internal instead of public (thus preventing UI code from creating Address instances)....

Wal972 replied on Wednesday, February 20, 2008

You might want to create a separate module for CRUD and validation and use an interface for interaction with child object and then create separate children for each parent because the address is being used in different use cases. The properties are repeated but key activities are kept central.

Cheers

Copyright (c) Marimer LLC