Questions tagged [domain-model]

A domain model is composed of the objects, behavior, relationships, and attributes that make up the industry that is the focus of development.

E.g. if you are in retail, you would model the "things" (classes) that are relevant, such as Sale, Product, and SalesTransaction. Read more here

359 questions
8
votes
1 answer

Domain driven design child entities change tracking

I'm having some difficulty figuring out how the Aggregate Root will track changes on child entities. Let say I have an aggregate: Order (root) OrderLineItem With the Order class being the aggregate root. How will I track the changes made on…
8
votes
4 answers

Dealing with an anemic domain model

I was trying to separate my DAL from my Business Layer, and in doing so, I decided to eschew any ActiveRecord approach and go for a DataMapper approach. In other words, my domain objects would not take care of persisting themselves. In doing so, I…
blockhead
  • 9,655
  • 3
  • 43
  • 69
7
votes
2 answers

Rails Domain model decoupling of Activerecord

I have been reading the book "SQL Antipatterns: Avoiding the Pitfalls of Database Programming" especially around the magic beans anti pattern. In it shows a diagram decoupling activerecords by using a domain model and has example in PHP, but not…
7
votes
2 answers

Grails: Best approach for storing data for the duration of the users session

Which of the following methods is considered the recommended way of storing data in grails for the duration of a users session? Store a bunch of individual variables in the actual session. Store a domain model class object in the session. Use a…
Harry Muscle
  • 2,247
  • 4
  • 38
  • 62
7
votes
1 answer

DDD, Doctrine2, Aggregates and ArrayCollection: how to isolate the domain model?

I'm trying to work effectively with DDD and Doctrine2 on a project with lot of business logic. I understand that we need decouple the domain objects from other concepts related to the system, i.e. in a layered architecture, "the domain layer" must…
Koryonik
  • 2,728
  • 3
  • 22
  • 27
7
votes
2 answers

ASP.NET MVC - view model, domain model and data model

I am using entity framework in my latest ASP.NET MVC 3 project. As it is DB first, the entity framework generates Database models. In my service (business) layer I Scaffold (MvcScaffolding) to generate service methods, views and controllers.…
7
votes
3 answers

AutoMapper flattens Domain Models but does it do the opposite? If not, what does?

I've been reading up on AutoMapper because of a response to one of my earlier questions here. It says that AutoMapper flattens complex domain models, but I need something that does the opposite. I need to wire up my view models (flattened domain…
Matt
  • 5,547
  • 23
  • 82
  • 121
6
votes
1 answer

Grails/GORM: creating one-to-one optional relationship

I'm designing a system in which posts/discussions between users can be upgraded to become tickets. At one particular place I'm trying to create a one-to-one optional relationship but am running into certain issues. A condensed version of the…
Sagar V
  • 1,916
  • 15
  • 23
6
votes
4 answers

Domain driven design: Avoiding anemic domains and modelling real world roles

I'm looking for some advice on how much I should be concerned around avoiding the anemic domain model. We are just starting on DDD and are struggling with analysis paralysis regarding simple design decisions. The latest point we are sticking on is…
g.foley
  • 2,152
  • 3
  • 19
  • 27
6
votes
3 answers

DDD - How Can I Avoid Crossing Aggregate Boundaries Here?

We're working on a new project (re-writing existing app), and I'm running into problems with my domain model / repository design. Here is a (simplified) version of two key portions in our domain model: As you can see, I have an abstract concept of…
RPM1984
  • 72,246
  • 58
  • 225
  • 350
6
votes
4 answers

Building an appointment booking system in Rails

I am looking to build an appointment booking app with the following characteristics: - Users can be service providers or buyers - Service providers set their availabilities (but can only set their availabilities at a maximum of 6 months ahead) -…
Karim
  • 1,303
  • 1
  • 14
  • 23
6
votes
4 answers

Data Mapper pattern, exceptions, and handling user-provided data

In applying the Data Mapper pattern, the model (Domain Model in my case) is responsible for business logic where possible, rather than the mapper that saves the entity to the database. Does it seem reasonable to build a separate business logic…
eoinoc
  • 3,155
  • 3
  • 24
  • 39
6
votes
3 answers

Grails - save the transient instance before flushing grails Error?

I am currently developing a Grails Application and I am working with the Spring Security and UI plug-ins. I have created the relationship between the User Class and another Area Class that I have which can be seen below: User Class: class User { …
user723858
  • 1,017
  • 3
  • 23
  • 45
5
votes
2 answers

CQRS applying cross cutting concerns such as security

Suppose I have a complex system where there large trees of people. Simple thoughts are employees / manager relationship, many employees report to one manager. Now in addition to manager there are support staff that are capable of acting on the…
Chris Marisic
  • 32,487
  • 24
  • 164
  • 258
5
votes
3 answers

How to represent mandatory business fields on a model structure?

If we use type hinting, we can place an object mandatory: public function myMethodThatDoFineStuff(MyObject $myobject) { } What if, we would like to place, not the all object but only some of it's attributes, to be mandatory ? Let's assume that our…
MEM
  • 30,529
  • 42
  • 121
  • 191
1 2
3
23 24