It would be the normal approach.  Each DomainObject would accept an IDomainVisitor and call back on it.  The visitor would collect useful info such that after calling the DomainObjects IsValid method, it could then check cross-dependency validation.

On 6/16/06, Ayende Rahien <[EMAIL PROTECTED]> wrote:

How would you call the visitor?

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Craig Neuwirt
Sent: Friday, June 16, 2006 3:56 AM


To: [email protected]
Subject: Re: [Castle-users] Using ActiveRecord with Legacy Database

 

Yeah, I like the decorator pattern too.  Haven't used it to your level though.  Although I can't use AR currently, I am thinking of making my domain AR entities so I can take advantage of the nice validation framework.  I would augment it with the Visitor pattern to accomodate validation depenendencies between entities.  Does that sound like a reasonable approach to you?

On 6/15/06, Ayende Rahien <[EMAIL PROTECTED]> wrote:

Depends.

I like to use generic decorator repositories, usually acessible via IoC.

So I get something like

 

repos =  Container.Resolve<IRepository<Customer>>()

repos is SecurityRepository

  -> inner is LogginRepository

   -> inner is ValidationRepository

     -> inner is LogicalDeletionRepository {turn Delete() to Cancel()+save() )

      -> NHibernate repository

 

On 6/15/06, Craig Neuwirt <[EMAIL PROTECTED] > wrote:

I know AR promotes validation within the model.  If you don't use AR, do you usually still put validation in your models or directly in the Business services or create a separate validation service.  Just curous

 

On 6/12/06, hammett <[EMAIL PROTECTED]> wrote:

Clarifying:

- with or without AR I create a DA layer.
- I usually work with models. If I'm using AR then AR entities are my
models. I just don't like invoking FindAll, or Create on the
presentation layer, instead I use a service layer that is aware of
business rules and its implications, so if later I have to add some
logic say, everytime a Customer is created, I just need to change one
place
- The only time I've used a dataset was to process some reports, where
the columns and aggregated columns were somewhat dinamically, and
more, the report was generated by a windows service to be viewed
later. For that situation only, DS was perfect. :-)

On 6/12/06, Craig Neuwirt < [EMAIL PROTECTED]> wrote:
>
> One last ? on this thread.  If you know you are not going to use AR, would
> you still create your Domain Model as AR Entities, or just pass POCO (or a
> DataSet) to your DA Layer.
>
> thanks for your feedback
>
>
> On 6/12/06, hammett < [EMAIL PROTECTED]> wrote:
> >
> Yep.
>
> On 6/12/06, Craig Neuwirt <[EMAIL PROTECTED] > wrote:
> > Gotcha!,  but you do pass the AR objects to your DA layer interface.
>
> --
> Cheers,
> hammett
> http://hammett.castleproject.org/
>
>
> _______________________________________________
>
> CastleProject-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/castleproject-users
>
>
>
>
> _______________________________________________
> CastleProject-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/castleproject-users
>
>
>


--
Cheers,
hammett
http://hammett.castleproject.org/


_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

 




_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

 




_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

 




_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users



_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

Reply via email to