anemic-domain-model

Is this a proper implementation of n-layer architecture?

瘦欲@ 提交于 2020-01-01 00:49:13
问题 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 doubts and want to make sure I am going down the right path before I convert my entire website over to this new architecture. The current website is old ASP VBscript and has a existing database that is pretty ugly (no foreign keys and such) so at

Is Anemic Domain Model a bundle of smart services and stupid object without a defined behavior?

雨燕双飞 提交于 2019-12-25 15:54:13
问题 I am a bit confused about what is a anemic domain model in OOP. Is a sort of bundle of Plain Old X Object (where X stands for the language you prefer), without behaviors (and responsibilities). class AnemicDomainClass { private $property; public function getProperty() { return $this->property; } public function setProperty($property) { $this->property = $property; } } ... where all the logic is inside some services? class SomeStuffService { public static function doSomething(AnemicDomainClass

Domain Model and Service Layer patterns in P of EAA

旧巷老猫 提交于 2019-12-20 10:39:12
问题 In Patterns of Enterprise Application Architecture, Martin Fowler talks about two patterns for organizing Domain Logic: Domain Model and Service Layer. The Domain Model pattern is the "pure OOP" approach, where models (those objects that are probably being looked up from the database using an ORM) contain business logic (albeit, probably only delegating to the logic in another class). The Service Layer pattern is like the Domain Model pattern, but with a thin layer in front of it containing

Rich vs Anemic Domain Model

亡梦爱人 提交于 2019-12-17 15:03:22
问题 I am deciding if I should use a Rich Domain Model over an Anemic Domain Model, and looking for good examples of the two. I have been building web applications using an Anemic Domain Model, backed by a Service --> Repository --> Storage layer system, using FluentValidation for BL validation, and putting all of my BL in the Service layer. I have read Eric Evan's DDD book, and he (along with Fowler and others) seems to think Anemic Domain Models are an anti-pattern. So I was just really wanting

How Single Responsibility Principle relates to anemic/rich domain model?

陌路散爱 提交于 2019-12-10 01:56:32
问题 Currently in doing some code review of stuff taken over from another team and have one doubt about applying SRP and its relation to anemic or rich domain model (as defined by Martin Fowler). Rich domain model concept is to have intelligent object that can not only set/get their properties but also can perform some more complicated business logic. I wond how it fits into SRP? Say I have my model class having some properties that can expose those props and provide some simple calculations on

anemic domain model versus domain model

不问归期 提交于 2019-12-09 04:21:29
问题 Being confused again after reading about this anti-pattern and the many concerns about it here on SO. If I have a domain model and capture the data that must be persisted in a data transfer object, does that make my domain model a wrapper around the data? In that case I would be using an anemic domain model. But if I add enough domain logic on that wrapper, at what point does it become a real domain model then? I get the impression that capturing what must be persisted in a domain model

How Single Responsibility Principle relates to anemic/rich domain model?

坚强是说给别人听的谎言 提交于 2019-12-05 01:26:21
Currently in doing some code review of stuff taken over from another team and have one doubt about applying SRP and its relation to anemic or rich domain model (as defined by Martin Fowler). Rich domain model concept is to have intelligent object that can not only set/get their properties but also can perform some more complicated business logic. I wond how it fits into SRP? Say I have my model class having some properties that can expose those props and provide some simple calculations on its properies. Next requirement is to have possibility to store this object data in some storage object

Is this a proper implementation of n-layer architecture?

和自甴很熟 提交于 2019-12-03 05:04:10
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 doubts and want to make sure I am going down the right path before I convert my entire website over to this new architecture. The current website is old ASP VBscript and has a existing database that is pretty ugly (no foreign keys and such) so at least for the first version in .NET I do not want to use and have to learn any ORM tools at this time. I

Avoiding anemic domain model - a real example

六眼飞鱼酱① 提交于 2019-12-03 00:18:36
问题 I am trying to understand Anemic Domain Models and why they are supposedly an anti-pattern. Here is a real world example. I have an Employee class, which has a ton of properties - name, gender, username, etc public class Employee { public string Name { get; set; } public string Gender { get; set; } public string Username { get; set; } // Etc.. mostly getters and setters } Next we have a system that involves rotating incoming phone calls and website enquiries (known as 'leads') evenly amongst

Avoiding anemic domain model - a real example

孤人 提交于 2019-12-02 14:00:29
I am trying to understand Anemic Domain Models and why they are supposedly an anti-pattern. Here is a real world example. I have an Employee class, which has a ton of properties - name, gender, username, etc public class Employee { public string Name { get; set; } public string Gender { get; set; } public string Username { get; set; } // Etc.. mostly getters and setters } Next we have a system that involves rotating incoming phone calls and website enquiries (known as 'leads') evenly amongst sales staff. This system is quite complex as it involves round-robining enquiries, checking for