Allows consider the typical web application scenario

  1. User clicks 'create TEST application' button starting a get request TEST application (within this situation .aspx)
  2. Just before loading the exam form

    a. Service Layer demands the exam Application Factory to produce a domain object
    b. Factory initializes a credit card applicatoin # along with other nested objects
    c. Factory returns the domain object
    d. Service takes assistance of an Assembler to produce a DTO and go back to the Presentation Layer

  3. User fills within the data and submits the exam Application
  4. Presentation Layer produces a DTO and transmits it across to service layer

Questions

  1. How if the system construct the domain object from dto after user submits the information back for validation?
  2. Must we make use of a factory or allow the mapper/assembler construct the Domain object from DTO?
  3. When we use mapper to create the domain object from dto it break the factory rule :(
  4. When we make use of the factory once more wont it recreate a brand new Application# for that domain object? rehydrate the domain object from DTO using Assembler?

How if the system construct the domain object from dto after user submits the information back for validation?

By locating it in the Repository/persistent storage.

Must we make use of a factory or allow the mapper/assembler construct the Domain object from DTO?

Neither.

When we use mapper to create the domain object from dto it break the factory rule :(

Factory may be the wrong factor to make use of. Factory accounts for beginning an entity's lifetime. Inside your referred to scenario (when i comprehend it), you have an entity that is available. It's lifetime has begun. Retrieve it out of your Repository, don't create a different one.

When we make use of the factory once more wont it recreate a brand new Application# for that domain object?

Most likely, which, again, is the reason why Factory may be the wrong piece to make use of here.

I actually do possess a question regarding your process here. You stated:

Just before loading the exam form

a. Service Layer demands the exam Application Factory to produce a domain object

b. Factory initializes an application # along with other nested objects

c. Factory returns the domain object

d. Service takes assistance of an Assembler to produce a DTO and go back to the Presentation Layer

But what which means is you are creating a website entity whenever a user sights a webpage. That appears quite wrong. I suppose I've trouble seeing the way a request to obtain a page should be thought about a request to create a website entity?