Questions tagged [anemic-domain-model]

A domain model is "anemic" if it has little or no behavior. A model that only contains things, parties and places with no activities, is considered anemic. For example, a model that has only a 'Car' and a 'Car Dealership' is anemic because there is no activity (behavior) in the model that joins the two. For example, a 'CarSale' or 'CarService' activity represents behavior that joins the two and makes the model useful. Contrast with an "anemic object".

Having a domain layer that is only getters and setters for data values to/from the database is not a good OO design. Read more here

66 questions
4
votes
2 answers

Is this an anemic domain model?

I'm trying to build my first CRUD application, and I don't understand if I should use an object containing getters and setters separated. Considering that we have the Zend Framework Quick Start tutorial with a Model structure…
MEM
  • 30,529
  • 42
  • 121
  • 191
4
votes
1 answer

Should you use Entity Beans for Domain Model

given the deprecation of loads of design patterns because of the new improvements in the Java EE world, DTO's are largely frowned upon. However, I dont want the relational structure of database to dictate how the client(web app) uses the services in…
4
votes
1 answer

Are DTO anemic model/anemic value object?

An anemic model is a model without ... "Anemic domain model is the use of a software domain model where the domain objects contain little or no business logic (validations, calculations, business rules etc.)." Is a DTO an anemic model without…
sensorario
  • 20,262
  • 30
  • 97
  • 159
4
votes
2 answers

How to deal with updating Entity (CRUD) and Domain Events using DDD?

I know that DDD is good with a Task-Based UI, but I'm refactoring a legacy app, where I have Anemic Domain Model (many setters without business logic). One of the first steps was to make it reach model and add Domain Events. While adding events for…
4
votes
1 answer

.NET Domain Model, when to eager load

I'm fairly new to the whole .NET scene and I'm still trying to figure this thing out. One thing that seems to be very advocated for is the Domain Driven Design pattern. And eager as I am to get a flying start in the .NET world and doing it proper I…
Patrik
  • 255
  • 3
  • 11
3
votes
2 answers

Domain Model architecture project in ASP.NET MVC

Are there any open source projects in ASP.NET MVC that use the Domain Model architecture instead of the Transaction Script (Service Layer) architecture? I'm looking for more of a project then just small examples.
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
3
votes
1 answer

Anemic domain object?

In my system, an user can publish any number of trips. Mi User class (domain object) is like this public class User { private String name; private String id; /* More private fields */ /* getters and setters */ } So if I want to get…
Marcos
  • 4,643
  • 7
  • 33
  • 60
3
votes
4 answers

Is this a proper implementation of n-layer architecture?

I have been learning C# for the last year or so and trying to incorporate best practices along the way. Between StackOverflow and other web resources, I thought I was on the right track to properly separating my concerns, but now I am having some…
jpshook
  • 4,834
  • 6
  • 36
  • 45
3
votes
0 answers

anemic domain model in case of entity frameworks

I've been reading up on this anemic domain model issue, which Fowler describes on his website. The way I understand it, he says domain model classes should contain the business logic connected to them because that's more OOP and has some other…
user3813234
  • 1,580
  • 1
  • 29
  • 44
3
votes
1 answer

Where to put domain objects in my application

So in my python django application the architecture is structured such that it is separated into different apps. One app for users, one for finance, etc. Each app has the following base structure: app_name models services tests I am…
3
votes
2 answers

The difference between anemic domain model and an entity

I am trying to get a firm understanding of DDD and having read Eric Evans book on Domain Driven Design and blogs from Julie Lerman they describe: Anemic Domain Model as a model with classes focused on state management. Good for CRUD. Entity as a…
Dr Schizo
  • 4,045
  • 7
  • 38
  • 77
3
votes
1 answer

From anemic domain to domain driven

I was trying to find a clear and simple example of what an anemic domain really means. There is a lot of theory around, and also many well answered questions. Still, I could not get a clear picture about to what extent "anemic domain" meaning really…
2
votes
2 answers

Where Should My Code Be For an Entity Insert That Requires Relationship Creation Before Persistence?

Situation: I am using LinqToSql (could be considered irrelevant) for my 'persistence layer' and am trying to work out some architectural concerns I have about where certain questionably business-related logic should go. The scenario: the user of the…
Merritt
  • 2,333
  • 21
  • 23
2
votes
2 answers

Circular reference between the services using the Anemic domain model

I am working on a project with a complex business. Consider two classes : AccountService and SchoolService I am using Unity and the dependency resolver of the Web API to implement dependency injection in the constructor. The school service uses the…
2
votes
1 answer

Effort to enhance

The question is from the from the patterns of enterprise application architecture by Fowler. My effort to enhance formula = d x r + c d number domain definitions(classes) r replication of definitions c complexity constant But having a hard time…
Rıfat Erdem Sahin
  • 1,738
  • 4
  • 29
  • 47