Re: [Wicket-user] How to best deffend models and entity classes
Guys, thanks for the answers but I don't think I explained my self.: I understad this is a solution. But how may I better defend models in general. What would be the purpose of a class with only getters and setters besides adding a new layer to the software? public class Person{ String firstName; String lastName; public Person(){ } public String getFirstName(){ return firstName; } public void setFirstName(String firstName){ this.firstName=firstName; } etc...etc.. } On 6/22/07, Igor Vaynberg [EMAIL PROTECTED] wrote: or create models that bind to xml, something like class XmlPropertyModel(String xml, String path) extends AbstractReadOnlyModel { Object getObject() { return XmlUtils.getPath(xml, path); } } add(new TextField(foo, new XmlPropertyModel(xml, address.street)); also create anl XmlCompoundPropertyModel(String xml) and you can do add(new TextField(address.street)); wicket can bind to anything, not just pojos. -igor On 6/22/07, severian [EMAIL PROTECTED] wrote: I'm not sure I fully understand your situation, but if your wicket front end is obtaining xml-serialised versions of business objects (or data transfer objects or whatever), can you not generate a simple Java version from the xml schema? Then perhaps your colleagues objections about having to redo the objects will disappear... -- View this message in context: http://www.nabble.com/How-to-best-deffend-models-and-entity-classes-tf3960566.html#a11247700 Sent from the Wicket - User mailing list archive at Nabble.comhttp://nabble.com/ . - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to best deffend models and entity classes
Francisco Diaz Trepat - gmail wrote: What would be the purpose of a class with only getters and setters besides adding a new layer to the software? Well (in the absence of further information), there would be no purpose. But there's no need to have these extra objects in the first place. If your services are written in Java, just use the pojo BOs (or DTOs) returned by these services as your model. If your services are written in some other language (C++) and return xml-serialised versions of BOs/DTOs, then just use the xml as the model (as Igor explained). No need for another set of objects, at least not for Wicket models. Or am I still missing something? -- View this message in context: http://www.nabble.com/How-to-best-deffend-models-and-entity-classes-tf3960566.html#a11288105 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to best deffend models and entity classes
Thanks I guess I will have to agree. Although I still think there are some good reasons to have structure like clasesses that only hold value. Some times it's good to have a changing state module that does not compromise final data, until last minute. I think it's best for unitest to have models that you can fill up to test behavior on customize data. It is true that in a general sensce you are adding a class that only receives setter calls from the Form trough the IModel Implementation (PropertyModel, CompoundPropertyModel, etc), but we are talking about some hundred bytes and microseconds of calls, assigment operations are very light. f(t) On 6/25/07, severian [EMAIL PROTECTED] wrote: Francisco Diaz Trepat - gmail wrote: What would be the purpose of a class with only getters and setters besides adding a new layer to the software? Well (in the absence of further information), there would be no purpose. But there's no need to have these extra objects in the first place. If your services are written in Java, just use the pojo BOs (or DTOs) returned by these services as your model. If your services are written in some other language (C++) and return xml-serialised versions of BOs/DTOs, then just use the xml as the model (as Igor explained). No need for another set of objects, at least not for Wicket models. Or am I still missing something? -- View this message in context: http://www.nabble.com/How-to-best-deffend-models-and-entity-classes-tf3960566.html#a11288105 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to best deffend models and entity classes
I'm not sure I fully understand your situation, but if your wicket front end is obtaining xml-serialised versions of business objects (or data transfer objects or whatever), can you not generate a simple Java version from the xml schema? Then perhaps your colleagues objections about having to redo the objects will disappear... -- View this message in context: http://www.nabble.com/How-to-best-deffend-models-and-entity-classes-tf3960566.html#a11247700 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to best deffend models and entity classes
or create models that bind to xml, something like class XmlPropertyModel(String xml, String path) extends AbstractReadOnlyModel { Object getObject() { return XmlUtils.getPath(xml, path); } } add(new TextField(foo, new XmlPropertyModel(xml, address.street)); also create anl XmlCompoundPropertyModel(String xml) and you can do add(new TextField(address.street)); wicket can bind to anything, not just pojos. -igor On 6/22/07, severian [EMAIL PROTECTED] wrote: I'm not sure I fully understand your situation, but if your wicket front end is obtaining xml-serialised versions of business objects (or data transfer objects or whatever), can you not generate a simple Java version from the xml schema? Then perhaps your colleagues objections about having to redo the objects will disappear... -- View this message in context: http://www.nabble.com/How-to-best-deffend-models-and-entity-classes-tf3960566.html#a11247700 Sent from the Wicket - User mailing list archive at Nabble.com. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user