On 8/24/05, Rick Reumann <[EMAIL PROTECTED]> wrote: > > > On 8/24/05, David Haynes <[EMAIL PROTECTED]> wrote: > > > > I'm confused here. If the EmployeeBean object is embedded in the > > EmployeeController and all the methods of EmployeeBean are available via > > the EmployeeController, why do you need the EmployeeBean directly? > > > Well for example after you used your backing bean to "get an employee" > (getEmployee method?), you would then want to display the employee name on > the page.. so you might have... > > employeeBackingBean.employee.name > > But that above would attempt to call 'getEmployee' which, if where my > initial confusion on 'best practice' came from since 'getEmployee' could > either mean 'get me the instance of the employee object from my backing > bean' or 'call some backend method to get me an instance of the employee > from the backend.' >
Why should the page author care which meaning is actually implemented? That should be up to the back end app developer. The contract between the person doing the back end and the person doing the front end needs to cover what value binding expressions to use to pull data from the model, or push data back to the model. Multiple approaches are possible -- and this is no different than the situation in Struts, where some people hang persistence tier model objects onto the form bean, and others stick them directly in request or session scope. The thing that matters is that the VB expressions actually work :-). WRT a completed CRUD example, on the list of things to do is make a Shale-ized version of the Struts mailreader app. Frank has volunteered to do that, but he's learning too ... it may be that I need to help get that started a bit so it can be fleshed out. Craig > -- > Rick

