--- Adam Hardy <[EMAIL PROTECTED]> wrote: > Is my understanding correct that Preparable and ModelDriven are 2 different > ways of doing the same thing, or are they complementary in any way?
They *could* be used to do the same thing, but IMO Preparable is more general-purpose than ModelDriven, and that's only if you're doing your model retrieval work in the actual model getter (which I guess a lot of people do?) > * ModelDriven: how do I get hold of my model during my action methods? I > don't want to get getModel() again, because that will retrieve another instance > of the entity and not the one that was populated by struts. Lazy initialization (via null check or by setting an instance var), or config through Spring, or... > * why do param-prepare-param instead of just prepare-param with > ServletActionContext.getRequest().getParameter("id") in prepare, > which would save a whole cycle through the param interceptor? Most likely to remove that step from the mainline code. It probably depends on how much logic is dependent on how many parameters. Personally I don't use Preparable very much, but that's just me and isn't a general commentary on its usefulness. I just find doing it "manually" is a bit more clear, particularly when I'm not the only person working on the code, even more so when the others aren't as used to the S2 request cycle. I'd definitely be interested in hearing other people's take on this issue, though, as I try to decide what long-term habits to use for S2 development. Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]