Questions tagged [domain-object]

Domain Objects are objects made for dealing with the domain logic at the Model layer. These objects generally simulate real (or virtual) items from real-life: Person, Post, Document, etc.

98 questions
3
votes
2 answers

Usage patterns/use cases for DI or when to start using it

I'm not sure for which use cases one should to use DI in the application. I know that injecting services like PlaceService or CalculationService etc fits very well but should I also create my domain objects with DI like a User? What is if the User…
Fabian
  • 2,428
  • 2
  • 21
  • 19
3
votes
1 answer

Using grails configuration values in domain object constraints

Grails 2.2.0 How do I access the custom configuration variables in a Grails domain object constraints. I would like to have something like this: class User { def grailsApplication String name static constraints = { …
Raipe
  • 786
  • 1
  • 9
  • 22
3
votes
1 answer

How can I Make a Successful Domain Object Factory in PHP

I'm fiddling with an MVC framework, and I stumbled upon a problem I'm not sure how to solve. I want to make a DomainObjectFactory for the Model layer of my application, however, each Domain object would have a different set of arguments, for…
Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308
3
votes
2 answers

Is a "domain object" any class that represents business rules?

I came across the term "domain object" and found a couple of definitions on Google but I just want to verify that my understanding is correct. Is this simply any class that represents business rules - since the word 'domain' usually means rules…
tom w.
  • 31
  • 2
3
votes
1 answer

How should a data mapper return a domain object?

In my model layer I have data mappers, domain objects, and "services" (to liase outside the model layer). I chose to implement a DomainObjectFactory and a DataMapperFactory, which has left me stuck on the DM<->DO relationship. Ideally the data…
orourkek
  • 2,091
  • 15
  • 22
3
votes
2 answers

AutoMapper Map single list on source object into two lists on destination object

I'm attempting to use AutoMapper to map from a Domain-object that contains a list of objects, where I have a boolean property, that I want to use a the property that AutoMapper uses to split that list into two destinations on the destination…
user191152
2
votes
1 answer

Application with interchangeable persistance layer

In 95% of examples I see, people are adding @Entity or @Document annotations to their domain objects. I would like to create an app in which I can easily change persistence layer. It should be possible to switch in settings from SQL DB to e.x.…
2
votes
1 answer

How should the domain object and data mapper interact within a service class for an auth system using MVC

I’m creating an authentication / login system using Slim 3 PHP on the back-end and Angular on the front-end and I’m trying to understand the ‘domain object’ and ‘data mapper’ part of a model layer within an MVC structure. I’ve read a lot of useful…
SneakyShrike
  • 723
  • 1
  • 10
  • 31
2
votes
0 answers

Should I use a limited-fields query or an all-fields object?

I've been trying to incorporate the repository pattern into my PHP app, loosely following this example. I'm trying to decide between: limiting which fields I retrieve from a database retrieving all of them and storing them in a domain object.…
Cohaven
  • 163
  • 1
  • 10
2
votes
2 answers

Javafx : Domain objects to TreeView

I have three domain objects in my app as follows : public class Workflow { private String name; private List sheets; } public class Sheet { private String name; private List tasks; } public class Task { private String…
drstonecodez
  • 317
  • 1
  • 2
  • 12
2
votes
2 answers

Domain object to persisting entity converting

I need to store domain object (DO) into DB. The simplest approach is to add into DO definition some JPA annotations like @Entity, @SequenceGenerator, @Table etc. but I don't want to mix DO with another conception like persisting. So I use separate…
Andriy Kryvtsun
  • 3,220
  • 3
  • 27
  • 41
2
votes
3 answers

Domain Driven Design - Value Object or Entity

I got a question about identifying a value object in the case below and how I must implement this. The case: In a online community users can make there own private/public page(s) (something like Facebook for example). Within this page they can make…
2
votes
1 answer

Submitting multiple grails domain objects at once

I have a form, where user can enter many records of the same domain class. Each of these records should be validated after the submission. In case of successful validation the collection of records should be passed to another view, otherwise…
rpozarickij
  • 1,477
  • 3
  • 14
  • 27
2
votes
2 answers

Java - Spring - Search Domain Objects

I have a controller that uses Spring to automatically map HTTP request params to business domain objects. I persist the field data in the domain objects to a database. I have another controller that needs to support searching on any combination of…
James
  • 2,876
  • 18
  • 72
  • 116
1
vote
1 answer

Spring Roo: fill a new entity instance with initial data?

I want to fill a new entity with auto generated data. For instance, I want to fill an entity field with a unique token. I'm thinking that this could be done in the constructor on the domain object. To my suprise I can't find a constructor for the…
conciliator
  • 6,078
  • 6
  • 41
  • 66