On Aug 29, 1:53 pm, Brendan Erwin <[email protected]> wrote:
> So, whether I have a Validation method called on the Entity, a
> Validation Command Object executed by the Entity, or a Validation
> Service which receives the Entity, I think it's clear that the actor
> will need to have the DAO injected. (It's also clear that testing this
> sort of complex behavior is going to be difficult and will require a
> fairly large amount of data/scenario setup.)
This is why I'd go the service route for this type of complex
validation. Inside the service you can use a composite-strategy
pattern to break up the little pieces of validation. The service and/
or the validators can take a dependency on as many different DAO's as
necessary to perform their respective tasks. As time goes by, if you
need to add new types of validation or remove old types, you can,
easily, without disrupting anything else. Each validation type is
easily unit testable, and the whole thing can be tested as an
integration test with something like Fit or Storyteller.
-Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---