Vote: Manager Model, Domain Model, or Both?

I finally got around to reading some of the follow up comments to Frans “Does SOA require Object Message Mappers? It depends.” post.  The comments can be summed up as follows:

+1 for Domain
- Jimmy Nilsson
- Mats Helender
- Yves Reynhout

+1 for Manager
- Frans Bouma
- Jimmy Nilsson
- Udi Dahan
- Andres Aguiar
- Mats Helender
- Yves Reynhout

Where exactly do I fall in the voting?  While I'm still trying to figure it out for sure, I think I fall somewhere in the middle.  On the one hand I like having behavior on my entity objects.  When I need to save a Customer I like being able to do customer.Save().  When I need to give an employee a raise I like employee.Raise(.50).  With that said I think I'm slowly moving toward a Manager model, here's why:

  • Certain business actions need to go through a manager.  To stay consistent using a manager for everything may make more sense.
  • Managers allow you to separate the business logic from the entities.  This allows you to apply different business rules depending on the operation.
  • Managers allow you to apply aspects easier.  Introducing logic to apply aspects within my entity objects is not something I'm comfortable with.
  • Business processes that involve many different entities make more sense in a manager then in your entity objects.  Coupling is bad, right?
  • It's more in line with SOA, after all a manager model could also be called a service model.

What's your vote?

# re: Vote: Manager Model, Domain Model, or Both?

Thursday, March 11, 2004 11:41 PM by Jimmy Nilsson    
Well, I'd like my name at both places too...
:-)

# re: Vote: Manager Model, Domain Model, or Both?

Thursday, March 11, 2004 11:49 PM by Steve    
Your wish is my command! :-) By the way I'm very interested in seeing your Domain Model framework! Sounds interesting.

# re: Vote: Manager Model, Domain Model, or Both?

Thursday, March 11, 2004 11:59 PM by Jimmy Nilsson    
Thanks Steve! Please note though that Christoffer Skjoldborg is the one that has done almost all of it. I can't take credit for that.
:-)

# re: Vote: Manager Model, Domain Model, or Both?

Friday, March 12, 2004 12:18 AM by Steve    
Does Christoffer have a blog? If so is he blogging about any of his experiences creating the framework?

# re: Vote: Manager Model, Domain Model, or Both?

Friday, March 12, 2004 3:06 AM by Christoffer Skjoldborg    
No Blog yet...but I gotta get one soon. I envision doing series of posts about the process of creating this framework with Jimmy. There are stuff for literally 100's of posts there I think!

# re: Vote: Manager Model, Domain Model, or Both?

Friday, March 12, 2004 4:03 AM by Steve    
Definitely could be 100's of posts. I developed an "Entity Framework" that I could talk about forever if I let myself. Drop me a line when you start up your blog, be very interested in the design decisions and overall architectural direction you took with it!

Oh and what are you waiting for! ;-)

# re: Vote: Manager Model, Domain Model, or Both?

Sunday, March 21, 2004 10:23 AM by hBifTs    
I'd like Manage Model.
As you say, "manager model could also be called a service model ",that is why I choose it....

# re: Vote: Manager Model, Domain Model, or Both?

Monday, October 11, 2004 6:34 AM by Bil Simser    
I'm on the fence and like Frans (and like almost any answer I give) it depends.

I'm more in the thinking of a service layer dealing with aggregation of Domain objects, with the Domain object dealing with it's down business as it relates the problem being solved. The Manager seem to me something that has both capabilties of an assembler and factory, with some knowledge about the Domain objects it's dealing with (a Domain object proxy?). Maybe it exposes the question of what operation(s) do the Domain objects need to be aware of/control. Their own or ones that involve other entities in the system?

Where that fits in (Domain vs. Manager) for me is more aligned to Eric Evan's DDD principles but not sure if it's one or the other.

# re: Vote: Manager Model, Domain Model, or Both?

Monday, October 03, 2005 6:33 AM by valko yotov    
definitely Manager Model - as Frans noted maintainability is the key - easy to inderstand code that's what I like when I review existing code, trying to extent some new functionality, SOA in my world is every time trying to extent some existing project/code with new functionality.

Extracting business logic from highly disparate OO Domain Model applications with very little or no documentation is a task which will make you think twice before praising Fowler OO aproach next time you start coding ;-)

# re: Vote: Manager Model, Domain Model, or Both?

Monday, October 03, 2005 6:34 AM by valko yotov    
definitely Manager Model - as Frans noted maintainability is the key - easy to inderstand code that's what I like when I review existing code, trying to extent some new functionality, SOA in my world is every time trying to extent some existing project/code with new functionality.

Extracting business logic from highly disparate OO Domain Model applications with very little or no documentation is a task which will make you think twice before praising Fowler OO aproach next time you start coding ;-)

# re: Vote: Manager Model, Domain Model, or Both?

Monday, October 03, 2005 6:36 AM by valko yotov    
definitely Manager Model - as Frans noted maintainability is the key - easy to inderstand code that's what I like when I review existing code, trying to extent some new functionality, SOA in my world is every time trying to extent some existing project/code with new functionality.

Extracting business logic from highly disparate OO Domain Model applications with very little or no documentation is a task which will make you think twice before praising Fowler OO aproach next time you start coding ;-)

# re: Vote: Manager Model, Domain Model, or Both?

Monday, October 03, 2005 6:47 AM by valko yotov    
definitely Manager Model - as Frans noted maintainability is the key - easy to inderstand code that's what I like when I review existing code, trying to extent some new functionality, SOA in my world is every time trying to extent some existing project/code with new functionality.

Extracting business logic from highly disparate OO Domain Model applications with very little or no documentation is a task which will make you think twice before praising Fowler OO aproach next time you start coding ;-)

# re: Vote: Manager Model, Domain Model, or Both?

Monday, October 03, 2005 6:59 AM by valko yotov    
definitely Manager Model - as Frans noted maintainability is the key - easy to inderstand code that's what I like when I review existing code, trying to extent some new functionality, SOA in my world is every time trying to extent some existing project/code with new functionality.

Extracting business logic from highly disparate OO Domain Model applications with very little or no documentation is a task which will make you think twice before praising Fowler OO aproach next time you start coding ;-)

# re: Vote: Manager Model, Domain Model, or Both?

Monday, October 03, 2005 7:26 AM by valko yotov    
definitely Manager Model - as Frans noted maintainability is the key - easy to inderstand code that's what I like when I review existing code, trying to extent some new functionality, SOA in my world is every time trying to extent some existing project/code with new functionality.

Extracting business logic from highly disparate OO Domain Model applications with very little or no documentation is a task which will make you think twice before praising Fowler OO aproach next time you start coding ;-)

# re: Vote: Manager Model, Domain Model, or Both?

Thursday, January 31, 2008 1:50 PM by Felipe Rodrigues    
Well, Domain Models can have Services objects as well. The problem with the Manager Model is when you use manager to perform any operation in your system. This is simply not OOP (maybe we could call that a kind of Machines Oriented Programming), because have a lot os classes that acts like machines, responsible to do every little thing in your system.

So, my vote goes to Domain Model

Post a Comment

 
 
Prove you're not a spammer: 
5 + 5 =