you could use if statements to make a property model with this... in fact, would be neat if Java had switch(String) statements. then you could just do a property model like this:

public Object getObject(Component component)
{
   switch (component.getName())
   {
       case "name": return userModel.getName();
       case "phone": return userModel.getAddress().getPhone();
   }
}

full property model and mapping information all right there in the code, with no reflection even...

Eelco Hillenius wrote:

That's allright I guess.

Jonathan Locke wrote:


yeah, i'm on the fence too on the properties file implementation in the core. but if we used Component instead of String, someone could implement that as an extension. if we use String, we're walled in forever. if we do this at all, i'd be much more in favor of getObject(Component) even if we just do Component.getName() for now. make sense?


     jon

Eelco Hillenius wrote:

Makes sense, but I don't like it. Next thing to introduce is some fancy XML binding! I like Wicket because it keeps things simple, and you don't need to browse through tons of configuration files to know what you're doing.

I also like stuff like Jan sent us:

class Row implements IModel
{
    private Map columndata;

    public Object getObject(String id)
    {
        return columndata.get(id);
    }
    public void setObject(String id,Object obj)
    {
        columndata.put(id,obj)
    }

So I am kind of +0.5 for changing IModel to the structure Jan proposed; I especially like the efficiency gain, and the fact that property model (or whatever its name would be in future) would look more natural. But anything that introduces any more 'magic' will actually make it fuzzier.

I'd like to know what Chris and Juergen think about this as well.

Regards,

Eelco


Jonathan Locke wrote:


uh, oh yeah, i guess obviously this:

public String propertyExpression()
{
return ((PropertyMappings)mappings.get(getPage().getClass())).expressionFor(this);


   }

needs to do the null check.  and not this:

public String expressionFor(Component component)
{
String expression = properties.get(component.getClassRelativePath());
return expression != null ? expression : component.getName();
}
;-)


so it would be:

public String propertyExpression()
{
OgnlBindings bindings = bindings.get(getPage().getClass());
return bindings == null ? getName() : bindings.expressionFor(this);
}


make sense? ;-)

Jonathan Locke wrote:




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop





------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to