Domain driven design - Entity is updateable in certain circumstances


TheMoo
25/12/2015 9:47 am
HOME ยป Programming Languages

Here is my business rule:

Anyone (anonymous users) can make an Application (as in to apply for something). Applications can be updated until they are reviewed and approved by an officer. Approved applications cannot be updated.

Therefore I created an abstract class

abstract class Application {
    //various fields of application form
    //fields do not have setters, but they have getters

    public enum State {APPROVED, UNAPPROVED};

    public abstract State getState();
}

And since an Application can be in two states, I modeled them like:

public class ApprovedApplication extends Application{
    //an approved application can only be created from an unapproved
application
    public ApprovedApplication(UnapprovedApplication ua) {
        //create it
    }

    public State getState() {
        State.APPROVED;
    }
}

and

public class UnapprovedApplication extends Application{    

    //only unapproved applications can be updated
    public void update(ApplicationDTO applicationDTO) {
        //do the updating
    }

    public State getState() {
        State.UNAPPROVED;
    }       
}

Am I on the right track here or is this complete garbage? And what about Officer approving the application? Getting a bit lost here.

UnapprovedApplication.approve(Officer o); 

or

Officer.approve(UnapprovedApplication ua); ?

Related to : Domain driven design - Entity is updateable in certain circumstances
Domain driven design - Entity is updateable in certain circumstances
25/12/2015 9:47 am by TheMoo in Programming Languages

Here is my business rule:

Anyone (anonymous users) can make an Application (as in to apply for something). Applications can be updated until they are reviewed and approved by an officer. Approved applications cannot be updated.

Therefore I cre


how design Domain driven Design with Entity framework codefirst entities?
by Anthony Perkins in Programming Languages

I need to design a windows application with EntityFramework CodeFirst. Previous module was developed with simple CLR objects, Inotification events and enterprise data access block. The component should compute on entity's property change event.


Requirements are


How to hand


Domain Driven Design Challenge - For which domain an entity belongs?
by Stringjam in Programming Languages

I'm analyzing a fairly enterprise resource planning software and because an ERP covers many areas from accounting to sales and CRM I have chosen to use Domain Driven Design. Now I have two questions :


What are main APPLIED (not in theory) resources to start DDD?
How can I find out
Entity Framework and Domain Driven Design
by Jason Terhorst in Programming Languages

After spending a few days trying to set up a simple application with EF and DDD I have to say that I feel quite frustrated and think that I was better off using Linq-to-SQL and forget all about DDD and EF.


With EF


a) You cannot have proper readonly collections



Domain Driven Design And The Entity Framework
by phokus in Programming Languages

I'm new to DDD and i want to use entity framework v4.0 (shipped with .net 4.0) in my new project.


since i have few time to learn DDD and entity framework, which books are good for me to read first?!


i'm going to first read Domain-Driven Design Tackling Complexity in the He


Domain Driven Design, .NET and the Entity Framework
by bps in Programming Languages

I'm new to domain driven design but want to learn it and use it for a new application.
I will be using Entity Framework for data access.


The basic layout so far is:


ASP.NET MVC and other clients (mobile
devices etc.)

|

Webservices


one repository for each root aggregate entity in domain driven design
by Georgia in Programming Languages

If you follow the repository pattern they... say to create a repository for each root aggregate entity.


That means when I have this model:


customer has orders
order has products
product has supplier


etc...


That would mean I have 4 reposito


Domain-Driven-Design - external dependencies in the Entity problem
25/11/2014 1:06 pm by fukas78 in Programming Languages

I'd like to start Domain-Driven-Design, but there are several problems I'd like to solve before starting :)

Let's imagine I have a Groups and Users and when user wants to join a group, I'm calling groupsService.AddUserToGroup(group, user) method. In DDD I should do grou


Domain Driven Design: access a configured value from an Entity without using a Service Locator
by Harry Truman in Programming Languages

I have a User entity which has a HasCompletedSecurity property which indicates whether that particular User has answered the number of security questions required by the system. The number of security questions the system requires is configurable and retriev


Design Approa: Responsibility Driven V Domain Driven V Behaviour Driven V Data Driven
by ozymandius42 in Programming Languages

Please can anyone tell me about the differences or relationships between different design approaches like
(1)Responsibility Driven
(2)Domain Driven
(3)Behaviour Driven
(4)Data Driven
Are they used in combination or only one at a time.

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .