Hi all,
I'm developing n-tier applications and I'd like some advice.
I have my data layer, business layer, and application layers.
The data layer uses a method similar to the one described here:
http://www.codeproject.com/cs/database/dal1.asp.
Business objects encapsulate the data access objects, and know which DA
object properties map to the Business object properties.. but if the DA
objects change, i'll also have to modify the business layer...
something i'd like to avoid.
So I was thinking of implementing a Factory pattern, where the factory
knows which DOs to use to build the appropriate BOs, but I'm not sure
if this is appropriate (or if there's an even better way).
I'm also trying to figure out where the Factory pattern would fit, if
thats the way to go. Would the apps, using static methods off of
Business objects talk to the business objects that way, or would it
talk to the factories? I'm leaning toward the former.. the Business
layer static methods call the appropriate factory to create the
objects.
Comments?
Thanks
Andy