For converting. I believe the thing we should actually doing when
converting is converting from input to output and back again instead
of just doing type conversion. Potentially that can mean converting
from one string representation to the other, e.g. when you want to
have formatting applied. You *can* do that without converters, but I
don't think it's very elegant to have to solve that by using special
models. You can even argue that the concept of converters is
unnecesarry at all, as you can do anything in your models if you want.
But I for one would like to see converters evolve to being input <->
output converters.

Eelco


On 5/6/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
thats fine, if they are plain strings why do you need those objects?


-Igor


On 5/5/06, Alexei Sokolov < [EMAIL PROTECTED]> wrote:
>
> Igor,
>
> POJOs are mapped to DB tables. Why would you have UsPhoneNumber or ZipCode
objects in your POJOs? Yes, you can map them as components, but I don't have
a reason to do it. In 99.9% of all cases you will have String properties.
> Address class is useful sometimes, but UsPhoneNumber & ZipCode classes? I
don't think so. Please correct me if I'm wrong.
>
>
> Alex
>
>
> On 5/5/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> >
> > any reason why the pojo works with strings instead of objects?
> >
> >
> > -Igor
> >
> >
> >
> > On 5/5/06, Alexei Sokolov < [EMAIL PROTECTED]> wrote:
> > >
> > > POJO
> > >
> > > public class Partner implements java.io.Serializable {
> > > ...
> > > private String name;
> > > private String zipCode;
> > > ...
> > > ...
> > > public String getZipCode() {
> > >    return zipCode;
> > > }
> > >
> > > public void setZipCode(String value) {
> > >    zipCode = value;
> > > }
> > >
> > > public class PartnerMixin {
> > > private Partner delegate;
> > >
> > > public PartnerMixin(Partner delegate);
> > > public ZipCode getZipCodeObj() {
> > >    return new ZipCode(delegate.getZipCode());
> > > }
> > > public void setZipCodeObj(ZipCode value) {
> > >   delegate.setZipCode(value.getStringValue());
> > > }
> > > }
> > >
> > > PartnerMixin does not have to be serializable, Partner does.
> > >
> > > Alex
> > >
> > >
> > >
> > > On 5/5/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > >
> > > > what does partner class look like before the mixin?
> > > >
> > > >
> > > > -Igor
> > > >
> > > >
> > > >
> > > > On 5/5/06, Alexei Sokolov <[EMAIL PROTECTED] > wrote:
> > > > >
> > > > > Good to know, thank you. As a work-around for now I'm using mixins
generated by cglib:
> > > > >
> > > > > Form form = new Form("edit.form", new
CompoundPropertyModel(MixinFactory.wrap(partner, new
PartnerMixin(partner))));
> > > > >
> > > > > method signature for MixinFactory.wrap: public static Object
wrap(Object parent, Object... mixins);
> > > > > ...
> > > > >
> > > > > Partner partner =
(Partner)MixinFactory.upwrap(getForm().getModelObject());
> > > > >
> > > > > And then in PartnerMixin I have methods like
getZipCode/setZipCode, getPhoneNumber/setPhoneNumber, etc. Works for me
until you guys come up with improved converters.
> > > > >
> > > > > If anyone interested, I can submit source code for MixinFactory.
> > > > >
> > > > > Alex
> > > > >
> > > > >
> > > > >
> > > > > On 5/5/06, Eelco Hillenius < [EMAIL PROTECTED]> wrote:
> > > > > > > And I would not worry about converters too much... I mean, it
is definitely
> > > > > > > should be addressed in the next release or so, but I don't
think it is a
> > > > > > > barrier to wider wicket adoption.
> > > > > >
> > > > > > They will be:
https://sourceforge.net/tracker/index.php?func=detail&aid=1453022&group_id=119783&atid=684975
> > > > > >
> > > > > > :)
> > > > > >
> > > > > > Eelco
> > > > > >
> > > > > >
> > > > > >
-------------------------------------------------------
> > > > > > Using Tomcat but need to do more? Need to support web services,
security?
> > > > > > Get stuff done quickly with pre-integrated technology to make
your job easier
> > > > > > Download IBM WebSphere Application Server v.1.0.1 based on
Apache Geronimo
> > > > > >
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > > > > > _______________________________________________
> > > > > > Wicket-develop mailing list
> > > > > > [email protected]
> > > > > >
https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to