I was under the impression that one should only access the next lower layer directly so isn't it strange to access both the BLL (Product) and the DAL (ProductFactory) from the presentation layer? Thanks.
I guess if you were to draw a picture, the factory sits halfway between the BLL world and the DAL world. Like thona said. Privately it has DAL components (like an ORM). Publicly its operations for BLL objects.
I usually use some kind of inversion of control pattern to model this more clearly and avoid direct dependency from BLL to data. Defining an required data access interface in the BLL (or corresponding) and let the DLL implement this interface and use a factory
which loads the correct implementation by an entry in the config file. This way the interface belongs to the BLL and thus can be used by presentetation. /M
THONA, Could you post an example of what the following GENERIC method would look like? Customer c = ObjectManager.Get (22); I'm currently into building a set of generic CRUD methods on a webservice, like GetItem(), UpdateItem(), etc. I still have casting problems
within my ObjectManager. Thanks.
>>I'm currently into building a set of generic CRUD methods on a webservice, like GetItem >>(), UpdateItem(), etc. I still have casting problems within my ObjectManager. Don't do that!!! For the love of god... don't do that!
::Could you post an example of what the following GENERIC method would look like? ::Customer c = ObjectManager.Get (22); You mean in source? Tricky - depends a lot on your implementation. Anyhow, partially metacode: public T Get where T : EntityObject { blablabla
(getdata) T retobject = (T) Activator.CreateInstance (objecttype); // Note the cast - we can not use a generic method here for various reasons, one being // that the actual type may be a subtype return retobject; }
>> I'm currently into building a set of generic CRUD methods on a webservice, like GetItem(), UpdateItem(), etc. I still have casting problems within my ObjectManager << WARNING WARNING danger Will Robinson! Web services are meant to be a service provider interface.
A service is not an object oriented system. A service performs some coarse grained / transactional activity. OO is great in the same process or maybe interprocess on same machine. However, once you want to access a system across a network OO breaks down.
guentherschm...
Participant
1446 Points
298 Posts
Re: Where does the O/R mapper fit in?
Jul 05, 2004 03:31 PM|LINK
Gabe Halsmer
Participant
880 Points
176 Posts
Re: Where does the O/R mapper fit in?
Jul 05, 2004 04:25 PM|LINK
michel_andre
Member
410 Points
82 Posts
Re: Where does the O/R mapper fit in?
Jul 05, 2004 05:52 PM|LINK
raphaelmiche...
Member
130 Points
27 Posts
Re: Where does the O/R mapper fit in?
Jul 23, 2004 01:04 PM|LINK
Raphaël Michel
:: TNM :: www.tnm.be
boyd5
Participant
1033 Points
226 Posts
Re: Where does the O/R mapper fit in?
Jul 23, 2004 02:30 PM|LINK
Systems Architect
thona
Member
20 Points
2923 Posts
Re: Where does the O/R mapper fit in?
Jul 23, 2004 05:11 PM|LINK
JOAC
Participant
1880 Points
376 Posts
Re: Where does the O/R mapper fit in?
Jul 23, 2004 07:57 PM|LINK