Hi,
i'm struggling a bit with repositories. I'm using C# and NHibernate. The question i have is : how much should my repository do before it calls a save or a get?
For example i have a user class which is an aggregate root. I want to call a method called "register" which will add the user and set some default values based on business ...
In my domain driven design I have a containing entity, say Car, which has a list of constituent entities, e.g. Wheel.
Now, I want to add a ChangeWheel method to my car entity. Note that changing the wheel does not actually modify the car entity as such. It only affects one of the entites in its wheel collection. I.e. the Car entity h...
I'm struggling with aggregates and aggregate roots. I have a natural aggregate root which works for about 60% of the user requests. I.e. those requests naturally apply to the aggregate root.
Within my aggregate I have another entity which can only exist as a member of the aggregate root. Users, however, will be told about this other ...
In Domain Driven Design are collection properties of entities allowed to have partial values?
For example, should properties such as Customer.Orders, Post.Comments, Graph.Vertices always contain all orders, comments, vertices or it is allowed to have today's orders, recent comments, orphaned vertices?
Correspondingly, should Repositori...
First off, my focus is web development (ASP.net webforms up to now), using C#. But, I am interested in learning design principles that will carry into any technology or language.
I have been ready for a long time to step up, and learn how to design software the right way. Up to this point, the software I write has been designing the dat...
I'm adding some logic to my web app to lookup geo-coordinates for a user, store them, then using those coordinates lookup the timezone and store that. My first go at this was to add a GeoCodeUser() method to a MappingService i had defined to do other map-related tasks. Because looking up the two bits of data relied on two different REST ...
If I want to build a DSL in Ruby 1.9 or JRuby, will I need to do any of these stages by hand:
Lexing
Interpretation
Parsing
Just-in-time compilation
Obviously, being a programmer, I don't like to write actual code as much as I can get away with, so I'm hoping none of these steps require manual labor :)
...
I'm working on my first DDD project, and I think I understand the basic roles of entities, data access objects, and their relationship. I have a basic validation implementation that stores each validation rule with it's associated entity. This works fine for rules that apply to only the current entity, but falls apart when other data i...
I'm attempting to model a grocery store. In the store, there are several "aisles". Each "aisle" has a group of "categories" of "items" it stores. Each "category" can only belong to one "aisle". Each "item" can only have one "category".
The data model seems straight forward to me:
An "aisle" table with an ID and DESCRIPTION
A...
What questions/solutions arise when Domain-Driven Design is practised?
I have found getting a grasp of it somewhat difficult as new situations keep arising, so I am trying to compile a list of good resources/questions in one place to assist me and anyone alike me having trouble grasping/implementing it.
...
Hey everyone,
I am working on a project using ASP.NET MVC, and repository model. I have repository classes, and services which consume these repository classes. My question is: Is it correct to return a IQueryable from my repository class and then use ".Where" and ".OrderBy" in a Service to generate a List? If yes, is it the best pract...
I have been reading up on multiple PHP frameworks, especially the Zend Framework but I am getting confused about the proper way to go forward.
Zend Framework does not use ActiveRecords but instead uses the Table Data Gateway and Row Data Gateway pattern, and uses a DataMapper to map the contents of the Row Data Gateway to the model, bec...
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 seem to be encroaching on the "anemic domain model" anti-pattern. For instance, one of the...
Hi,
I'm trying to build a document management system and despite all the thigns i've read about entities, value objects, how to choose between how to map them etc... i still can't figure out what the "correct" way to do it is. Quite typically in such a scenerio, each document can beong belong to one or more categories, can be viewed by...
I'm wondering what strategies people are using to handle the creation and editing of an entity in a master-detail setup. (Our app is an internet-enabled desktop app.)
Here's how we currently handle this: a form is created in a popup for the entity that needs to be edited, which we give a copy of the object. When the user clicks the "Can...
I have a reference application that I use to work through DDD issues, and my current focus is on persistence. An alternate title for this post could have been DDD / TDD persistence tools and methods, but that is a (very) broad topic and I do have a specific question on SQL Server.
I'm going to outline my current tool set in this paragra...
I am wondering how the shift from relational, table-based design to object-oriented, entity-based design is affecting the mindset of developers writing the next wave of applications.
Given the nature of the debate swirling around the Entity Framework and Linq to SQL, is it premature to be thinking about entity-driven design?
Are we bri...
Hi. The question title might not be clear but what I want to do is something like this:
This is how I layer out my app
App.Domain
App.Services
App.Web
What I want is, if I request something like /api/OrderProcessor/GetAllOrder it will call method GetAllOrder in App.Services.OrderProcessorService.
The method will return an IL...
I have the following database tables. Primary keys are ID and AnimalType.Type is a unique string.
Animal
- ID
- Name
- TypeID
AnimalType
- ID
- Type [Herbivore, Carnivore]
My classes are as follows.
public class Animal
{
public int ID { get; private set; }
public string Name { get; set; }
public AnimalType Type { get;...
In a project at work we have a certain value type class in our domain model that includes a very large number of attributes...
public class BigValueType {
private Foo foo;
private Bar bar;
private Baz baz;
//...
}
We've realized that we would like to "focus" this into a number of different, somewhat more specialized c...