You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2007/05/24 20:45:47 UTC

[Myfaces Wiki] Update of "A simple Crud Cycle" by WernerPunz

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by WernerPunz:
http://wiki.apache.org/myfaces/A_simple_Crud_Cycle

New page:
= Best Practices - A simple Crud Cycle =
== Introduction ==
The central core of most applications are masks for data display and editing. The application cycle those set of maskes and operations perform is called the Crud Cycle (Create Update Delete Cycle)

What do we need for such a cycle:

We need a master view and one or several detail views for creation updating and deleting datasets.
For the sake of readability we try to focus on the view controller level, in assumption that our business and dao layer does what it should do.

== Commpon operations of create update and delete cycles ==
  1. Display a master maske (often with search functionality) displaying a set of datasets with subsequent operation triggers for our create, update and delete workflows.
  2. Display a create mask which allows the entry of new data and triggers a save of this data
  3. Display an edit mask, which allows the alteration of existing data and the save of the alterations
  3. Display a delete confirmation mask which asks you before you delete a dataset
  4. (optional if not done by one of the other masks, display a view only mask which allows to view datasets as needed.

== Simple Crud Mask ==

Lets start with a simple CRUD mask, lets assume we have a simple user manager for mastering a user database...

What do we need:

  * A master view controller
  * A Detail view controller

  * A master JSF page
  * A detail JSF page
  * A Delete confirmation page

  * the associated DAO and BO objects


=== The Master View ===

The master view should be the central entry point for the crud cycle, it should display a set of datasets which then can be further processed, it can contain various search entries etc... for limiting the number of datasets displayed.