5

I want to start new application on ASP.NET MVC4 using different different approach like domain driven development , design patterns , dependency injection , Entity Framework as ORM etc.

Need some advice on what should be the starting point of development? Should I start with first relationships of classes or start with traditional approach? e.g there are three module.

  1. User Management.
  2. Logging.
  3. Error Logging.

Should I first complete with user management like domain classes then its services and then its CRUD operations in actual web application? and after that ...will start with logging (same process as mention in user management). and then in error logging as well.

So What are best practices to start development using those kind of concept or tools?

2 Answers 2

10

ASP.NET MVC4 is just a presentation part of solution. With Domain-Driven approach you start with domain (usually separate library project) and then add presentation (web site, desktop application etc) and persistence (implementation of repository and uof interfaces declared in your domain).

So, you start with creating domain model (not whole, but part of that). Then in any order you create UI which uses you domain model, and implementation of repositories for persisting your domain model via Entity Framework. Well actually views should use ViewModels (otherwise your POCO domain objects will be polluted with Data Annotations attributes and other stuff). It's a controller part where you will use domain model. Also you will inject repository implementations to controllers via dependency injection.

Sign up to request clarification or add additional context in comments.

3 Comments

So you are trying to say that first we should create domain model for all modules and then use those domain models into presentation part?
@DharmikBhandari not necessary for all modules (only if you are going waterfall DDD). Create your application iteratively. E.g. create some aggregate root. Then create repository for that aggregate. Then add UI for CRUD operations on that root. After this iteration you will have working slice of application. Then extend domain with new objects and services and create persistence and UI for them.
@lazyberezosky : this must be a great answer. It helps me a lot. thank you so much
5

I would start by looking at the business functionality requirements of the system and focus on the highest value requirements first. Implement those, filling out your business domain as you need to, based on delivering the requirements. If you follow a BDD style process, you can use unit tests to drive out the business functionality and your domain will evolve as the business requirements evolve. Each business requirement should have a UI and data access component to it so you can fill out the presentation layer and data access layer with Entity Framework as the domain evolves. Here's a couple of useful posts on BDD:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.