views:

49

answers:

1

I am working on a customer sign-up workflow.
As expected, there are multiple steps that collect information. I need to store the results of each step until the workflow is complete. Once the workflow is completed then everything is written to the database. If the user leaves the workflow half-way through they will have to start over from step 1.

I have a domain model that is based on nHibernate. I will use domain model and nHibernate to persist customer information to the database.

I am wondering what the best approach is here and I'm open to suggestions.

Use domain model to collect and store the information through entire process

As information from each page is submitted, a domain entity will be created and stored (it can't be stored in DB). At the end of process, the entities will all be committed.

  • How is the entity stored?
  • In session state?
  • In nHibernate session? If so, how is nHibernate session persisted between page requests?
  • do i create a transaction on the first step and then commit on the last step?
  • do i need to detach the entities from nHibernate session, persist them into session state and then at the last step readd them to nHibernate session?
+2  A: 

Use NHibernate.Burrow, or collect information in DTOs, then dump all information to the real entity in the last step.

Mauricio Scheffer