On Nov 6, 11:48 pm, Brian Pontarelli <[EMAIL PROTECTED]> wrote:
> > +1 Imho Guice will be less invasive and can be applied to core of my
> > system (domain model)
>
> I've seen this a few times and wondered what people are injecting into
> domains? Are you using a        non-anemic domain and injecting other
> domains or services into?
>
> -bp


http://www.infoq.com/articles/ddd-in-practice

"'Anemic Domain Model' where facade classes (usually Stateless Session
Beans) start accumulating more and more business logic and domain
objects become mere data carriers with getters and setters."

Hm, With anemic model you dont need injeting into model because it is
only data holder.

In non-anemic model there is model, services (ejb3) and many helpers
with support core model and have to be close it.

# Model

class Cat {
   public boolean checkVirusRisk() { ... }
}

# Services

class CatService {
   find();
   save();
   rent();
}

# Helpers

class VirusStrategy {
  boolean isBlackListed();
}

class UsaVirusStrategy implements VirusStrategy {
   @Inject connectionToFBI;
}


So when you create model and on next time client require you to invoke
service (without injecting you cant invoke service from model, unless
as parameter for method model) and you will have to move implemented
funtionality from Model/Helpers to Services which ends Anemic model
(all logic are in services).

In bussiness system there is many abstraction in core system:
connection to ldap, db, xml, many factories, authorization,
optymalization like caches, views, builders, kontrolers, managers
sessions and many other. I think support for this abstraction like IoC
close to core system it will be added value to system. Guice configure
system with defaults and in tests or during intergration with other
system you can ovverride some system policy (example for ldap).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" 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/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to