>Oh - and also that the user will never see any changes to the database
>made concurrently by other users. That may be desirable, or maybe not.
>Of course if it is desirable, then a read before each render has to be
>done. 

>Cheers,

>Simon

I forgot about that! In that case a simpler pattern would work nicely:

preserveDataModel="true" always,

and

public DataModel getDataModel() {
    return new LocalDataModel(.);
}

This will still cut out the database access during the Restore-View phase,
and would be sufficient for almost all cases.

For those who are really efficient conscious - my original pattern can still
be used (maybe with 'refresh' button for user to refresh the data). I don't
think there will be any significant differences between these two patterns
in real cases.

I think components that do not save its state are 'wrong'. JSF handles this
by calling the backing bean, while ASP.NET simply left them blank - but both
are wrong in their own way. 

In ASP.NET once a component is specified to participate in viewState then it
behaves like my first pattern. But there is no equivalent to the second
pattern. In ASP.NET you simply have to do refresh a dataTable manually.

I am really happy to find a frame of comparison between these two
frameworks. JSF does has its advantages - but it has been hard work trying
to figure out how to use it properly though.

Regards,
Yee



Reply via email to