RE: Transaction spanning multiple business classes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Implementing UnitOfWork and the related patterns (e.g. datamappers) is
probably not something you can do in a matter of minutes. I have tried
googling for some samples without any luck.

If you are in a hurry and do not have time to read through Fowler's book,
you might just opt for the easy solution and pass a reference to a
transaction object as a parameter. Another fairly easy solution is to
register a transaction object using some kind of Registry pattern and then
let the Insert and Update methods access the registry using a unique ID to
get a hold of the transaction. But the transaction would still have to
started by your business logic. Fowler also describes the Registry solution.

HTH, Jakob.

--
http://www.dotninjas.dk


"Klenne" wrote:

> Hi Jakob
>
> I know the patterns a little bit but i can't seem to get started
>
> How would i implement this given the scenario i'm in?
>
> Thanks for the help!!!
>
> > > public class PersonService
> > > {
> > > public void InsertMailingAddress(data)
> > > {
> > > //ask the AddressService to insert an address
> > > new AddressService().InsertAddress();
> > >
> > > //update the person with the ID from the newly inserted address
> > > }
> > > }
>
.



Relevant Pages

  • Re: [PHP] first php 5 class
    ... ya, it is sort of dead, sad, but its still worth a look to people ... patterns implemented in php. ... I am okay with a registry that uses static methods because ... its sorta like the 'php way' for the registry. ...
    (php.general)
  • Re: Singleton Registries...
    ... but only as a way to implement a singleton as a Registry ... Base Patterns section near the end. ... > Colin Basterfield wrote: ...
    (microsoft.public.dotnet.languages.csharp)
  • Pattern Question
    ... I am having a discussion with someone in my office about two patterns. ... plug-in and registry. ... What we are building is a global definition of what type to use in a ... plug-in but here is my problem. ...
    (comp.object)
  • Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?
    ... patterns, to transparently create the objects on first access: ... class Registry: ...
    (comp.lang.python)