Re: [Wicket-user] How to best deffend models and entity classes

2007-06-25 Thread Francisco Diaz Trepat - gmail

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

2007-06-25 Thread severian



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

2007-06-25 Thread Francisco Diaz Trepat - gmail

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.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

2007-06-22 Thread Igor Vaynberg

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


Re: [Wicket-user] How to best deffend models and entity classes

2007-06-22 Thread severian

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


[Wicket-user] How to best deffend models and entity classes

2007-06-21 Thread Francisco Diaz Trepat - gmail

Hi guys, I think I'm about to get into an argument about models and I wish
to discuss it here first, if you don't mind.


Here is the general argument.

Entity classes with only getters and setters don't do any good because they
just put an innecesary extra layer in 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..
}

I preatty much disaggree with this, and cannot find the right explanation.

As for wicket, we are bound to used wicket models with some kind of entity
holder (as Person is).

For instance one request I just got is:

As the C++ libraries with business logic will return XML representing
objects (like *Municipality, Person, Tax, etc.*) on the other side of the
business server lets not redo those objects in the wicket project. For
example generating something like:


private final Tax taxEntity = new Tax();   //Being Tax something like
Person Above.
Form form = new Form("incomeTaxForm", new CompoundPropertyModel(
this.taxEntity));

Or worst, for this opinion against models, a model bound specifically for
one form. Business logic applyed here is, we will need to code a bit more.


If you can, please help me construct a more reasonable explanation than
"ehh dada!!!" :-) [EMAIL PROTECTED]

best regards,
f(t)
-
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