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 2008/08/12 23:05:03 UTC
[Myfaces Wiki] Trivial Update of "A simple Crud Cycle" by LuisParravicini
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 LuisParravicini:
http://wiki.apache.org/myfaces/A_simple_Crud_Cycle
The comment on the change is:
corrected typos
------------------------------------------------------------------------------
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 ==
+ == Common 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.
+ 1. Display a master mask (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
@@ -22, +22 @@
What do we need:
- * A master view controller
+ * 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 associated DAO and BO objects
=== The Master View ===
@@ -142, +142 @@
implements ConversationBindingListener {
}}}
- the ConversationBindingListener provides these callbacks and could be used for our page controllers for preinitialisation
+ the ConversationBindingListener provides these callbacks and could be used for our page controllers for preinitialization
of pages.
The valueUnbound is equally interesting, it allows the freeing of resources before the conversation finally is terminated,
@@ -195, +195 @@
No we "misuse" an action method in our detail view controller for
- preinitialisation and load our working room object from the database
+ preinitialization and load our working room object from the database
into the ram.
So what do we have now
@@ -243, +243 @@
}}}
This is a reference to our preloaded object, which is still alive, despite having crossed the request boundary. All changes
- done now in this form are directly passed into our peristable object, which still has references to the underlying db orm mapper.
+ done now in this form are directly passed into our persistable object, which still has references to the underlying db orm mapper.
Now to the interesting part:
{{{
@@ -346, +346 @@
*Note
- At the time of writing in our own testcases the valuebound mechanism was not used for detail initialisation, it might be possible to
+ At the time of writing in our own testcases the valuebound mechanism was not used for detail initialization, it might be possible to
- use it, I will investigate further into this, the usage of actions instead of using valueBound for the detail preinitialisation
+ use it, I will investigate further into this, the usage of actions instead of using valueBound for the detail preinitialization
is perfectly viable and correct, but to keep a common pattern it might be better to use valueBound instead.