tvoss wrote:
I finally got time to read about adapter.
Sort of shocked I must admit. I really liked the one liner:
dim customer as New CustomerEntity(19)
versus the new 3 line version.
Heh
It's indeed not servicing itself, so it requires a little more work.
Do I understand correctly that the main advantages of using an Adapter if we decide to is:
1) superparent.save() can orderly save any dirty child properties
This is being ported back to SelfServicing as well.
In fact, I've just finished implementing this in SelfServicing (all tests went ok) and will be available soon (have to add some more changes to selfservicing as well)
2) control of connect, command properties
???
Among other things. Adapter is not for people who want to have the most easy to use dal layer, as it requires more work (thre is no load-on-demand, you have to create teh adapter object yourself etc.). However the ease-of-use of selfservicing also comes with a price: it is pretty limited if you want to create a class hierarchy from the derived classes. It's also pretty limited if you want to support multiple database systems using a single entity set (as some people are doing: supporting both oracle and sqlserver in one application). Selfservicing can also be a no-go if your organisation demands that objects used in the GUI shouldn't be able to persist themselves (some organisations demand this) so GUI developers have to use the BL classes to get things done which automatically avoids errors in teh application because some developer took a shortcut due to a deadline
. Adapter is also the better template group for remoting scenario's where you don't need persistence logic on the client anyway.
It's about how you look at things: if persistence behaviour should be part of the object itself, selfservicing will be more appealing. If you look at it in the way that persistence behaviour is added to your object as a service, adapter is more appealing. With the 2 types, the choice is there.