Am Freitag, 2. Mai 2008 12:22:53 schrieb James Carman:
> I don't usually mock the actual models.  If I'm using a
> LoadableDetachableModel, I'll mock the DAO or "repository" that the
> model is using to find its data, but I never actually mock the model
> itself.
But then i have to know the structures "under the IModel". Don't misunderstand 
me. I don't mean IModel and wicket related structures - i mean stuff from the 
IModel.getObject() instance (business object). And that's exactly what i try 
to avoid. I only try to access everything by the property name.

The background is the following:
In our project everyone has access to "business model instances". They simply 
get the interface and call the appropriate (get/set) method. We now tried to 
refactor some code and found that we have "deployed" business logic all over 
our panels and pages. Thats because you can access deeper model by the 
accessor chain. That sucks :-).

So i set up a little test project. In this the frontend components have only 
access to the "business interfaces". Within this you only have some methods 
defined like "doMyBusinessStuff()". There are no more getMyModel() and stuff 
like that. 
The accessible way for component binding is using a constant for property name 
in association with a PropertyModel. The real accessor methods 
(getter/setter) are departed in another "accessor interface" which can't be 
used from within the frontend (and thus is hidden for frontend tests to).

So i would like to ignore the "accessor interfaces" and only use the calls for 
the propertyname to return the appropriate IModel instance.

Thanks
Per

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to