Hello olduncleamos,
oWhat is, in general, the preferred practice to transfer data between
obusiness objects and the data layer? To be more specific, I have a
ocouple of business objects with state data that are stored in
oexternal storage. The data layer take care of communicating with the
ostorage and return data in dataset or file stream or simple arrays.
oHave the business objects directly consume a dataset seems
oinflexible. What would be the prefered way of handling this most
ocommon situation?
Everything depends on your requirements - if they are always (that usually
ends up they are not in some time later) will be physically nearby there
is no bad to consume DL directly. And it's not the problem to distribute
them later with using WS/COM+/.NET Remoting, the problem is the interface
for the communication - your all data communications should be performed
through well-known (read published) contract (read interfaces)
oTo take this discussion further, let say that the current requirments
oonly requires data to come from a single source. But it is clear that
odifferent data sources will be needed down the road. Would this extra
oconsideration impact your design? If so, how?
You can create DL Factory class that will be used by BL and will responsible
for creating specific DL objects to do some kind of job or your can incapsulate
your data sources in interfaces - look at the DataBase providers architecture,
your just have the set of interfaces and your are free to know which DB (oracle,
sql) u are using
---
WBR,
Michael Nemtsev :: blog:
http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche