On 9/20/06, Ameeta Dabke <[EMAIL PROTECTED]> wrote:
Hi, Using JSF I am working on a simple example which saves employee data into database.I have : 1. Created a employee jsf which will have 'Save' button 2. On click on 'Save' button a method Employee backing bean's saveEmployee() will get called. 3.Via this method have given a jdbc call which inserts employee data into database. My doubts: 1.Is this the correct way am I following? or is there any other better way of saving data using JSF?
This is certainly the approach that requires the least work, although it does require your application to understand the details of how your database is organized (table and column names, how to generate a primary key value, and so on). Alternatives to consider would be using on "Object Relational Mapping" library like Hibernate, iBatis, or the new Java Persistence Architecture to hide that level of detail, and let your application do simple manipulations on JavaBeans representing the persistent data. 2. My manager asked me to use Shale architecture along with JSF. But I
am not aware how to use this Shale architecture. I went through the website but could not figure out how it can be used.Any inputs please?
The most relevant part of Shale for this purpose is most likely to be the View Controller[1]. There are two sample applications (both based on the Struts Mail Reader sample app, but using different approaches to storing the data: shale-mailreader and shale-mailreader-jpa. These apps are available as part of the 1.0.3 release[2], and also as part of the nightly builds[3]. 3.Can you provide me good links for learning Shale architecture? The "Features" pages of the web site are your best current bet, followed by the package level descriptions in the javadocs. Thanks..
Ameeta
Craig [1] http://shale.apache.org/features-view-controller.html [2] http://people.apache.org/dist/shale/v1.0.3/ [3] http://people.apache.org/builds/shale/nightly/
