Re: am I doing right? entities no Serializables.
Thanks!. But I have a Wizard in my case How wicket would populate again if my entities are not serializable? ps: nice your book!! On Thu, Apr 24, 2008 at 9:55 AM, Martijn Dashorst < [EMAIL PROTECTED]> wrote: > for a new entity you can always return a new entity. There is no need > to keep the filled in data between requests :-) as the fields have the > data already... When you return a new object Wicket's form update > mechanism will repopulate the object's fields. > > Martijn > > On 4/19/08, Fernando Wermus <[EMAIL PROTECTED]> wrote: > > I try to spend the less memory I can using LoadableDetachableModel. But > if > > the user is filling up a form for a new entity I think I have two > options, > > one serialize and the other create a kind of dto. I don't like the first > > because I don't want my domain model be modified by the web tier > > (Serializable interface) and I don't like the second because I prefer > > languages as Smalltalk, Grovee or Ruby which you don't need dtos either > > serializable interfaces. That's why I was speaking up. I like wicket and > > maybe I could find another way. > > > > ps: I am using db4o as my data object base (in this prototype). I know a > guy > > who make wicket serialize their entities using db4o, but I don't know > how > > hard is replace the serializable wicket mechanism. > > > > On Fri, Apr 18, 2008 at 7:30 PM, James Carman < > [EMAIL PROTECTED]> > > wrote: > > > > > > > I like for my entities to always be serializable. Is there some > > > special requirement to have a non-serializable field on your entity > > > class? > > > > > > On Fri, Apr 18, 2008 at 4:50 PM, Fernando Wermus > > > <[EMAIL PROTECTED]> wrote: > > > > I am finishing my first app for production in wicket. As any newbie > I try > > > to > > > > make a side relevant non-functional problems to focus in which I > > > consider > > > > important. > > > > I was implementing Serializable in all my entities, but I have to > change > > > now > > > > that. I ve done it using LoadableDetachableModel. But I couldn't do > it > > > in > > > > some parts. When the user walks over a wizard to create an entity, > I > > > just > > > > attached to the wizard a new entity and, finally I persist it in > the las > > > > step. But, I have to change that now, because the entity is not > > > Serializable > > > > anymore. > > > > > > > > Which is the best way? > > > > > > > > I think it is attaching a model which have all the attributes > needed for > > > the > > > > creation of the entity and at the end I have to copy the whole > > > information > > > > to my entity, doesn' it? (like I was doing with j2ee DTO :( ). Then > I > > > have a > > > > modelForm of the view and my entities at the end of the steps. > > > > > > > > Is there a best approach to it? > > > > > > > > Bye! > > > > > > > > ps: sorry for my english. > > > > -- > > > > Fernando Wermus. > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > -- > > > > Fernando Wermus. > > > > > -- > Buy Wicket in Action: http://manning.com/dashorst > Apache Wicket 1.3.2 is released > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2 > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Fernando Wermus.
Re: am I doing right? entities no Serializables.
for a new entity you can always return a new entity. There is no need to keep the filled in data between requests :-) as the fields have the data already... When you return a new object Wicket's form update mechanism will repopulate the object's fields. Martijn On 4/19/08, Fernando Wermus <[EMAIL PROTECTED]> wrote: > I try to spend the less memory I can using LoadableDetachableModel. But if > the user is filling up a form for a new entity I think I have two options, > one serialize and the other create a kind of dto. I don't like the first > because I don't want my domain model be modified by the web tier > (Serializable interface) and I don't like the second because I prefer > languages as Smalltalk, Grovee or Ruby which you don't need dtos either > serializable interfaces. That's why I was speaking up. I like wicket and > maybe I could find another way. > > ps: I am using db4o as my data object base (in this prototype). I know a guy > who make wicket serialize their entities using db4o, but I don't know how > hard is replace the serializable wicket mechanism. > > On Fri, Apr 18, 2008 at 7:30 PM, James Carman <[EMAIL PROTECTED]> > wrote: > > > > I like for my entities to always be serializable. Is there some > > special requirement to have a non-serializable field on your entity > > class? > > > > On Fri, Apr 18, 2008 at 4:50 PM, Fernando Wermus > > <[EMAIL PROTECTED]> wrote: > > > I am finishing my first app for production in wicket. As any newbie I try > > to > > > make a side relevant non-functional problems to focus in which I > > consider > > > important. > > > I was implementing Serializable in all my entities, but I have to change > > now > > > that. I ve done it using LoadableDetachableModel. But I couldn't do it > > in > > > some parts. When the user walks over a wizard to create an entity, I > > just > > > attached to the wizard a new entity and, finally I persist it in the las > > > step. But, I have to change that now, because the entity is not > > Serializable > > > anymore. > > > > > > Which is the best way? > > > > > > I think it is attaching a model which have all the attributes needed for > > the > > > creation of the entity and at the end I have to copy the whole > > information > > > to my entity, doesn' it? (like I was doing with j2ee DTO :( ). Then I > > have a > > > modelForm of the view and my entities at the end of the steps. > > > > > > Is there a best approach to it? > > > > > > Bye! > > > > > > ps: sorry for my english. > > > -- > > > Fernando Wermus. > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > Fernando Wermus. > -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.2 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: am I doing right? entities no Serializables.
On Fri, Apr 18, 2008 at 11:50:59PM -0300, Fernando Wermus wrote: > I try to spend the less memory I can using LoadableDetachableModel. But if > the user is filling up a form for a new entity I think I have two options, > one serialize and the other create a kind of dto. I don't like the first > because I don't want my domain model be modified by the web tier > (Serializable interface) and I don't like the second because I prefer > languages as Smalltalk, Grovee or Ruby which you don't need dtos either > serializable interfaces. That's why I was speaking up. I like wicket and > maybe I could find another way. Those other languages are not magical. They still have serializable and non-serializable objects. An object containing a reference to a file handle or database connection will not be serializable in any language. You just don't get to find out that your object wasn't (safely) serializable until you restore it and it starts failing. Java's Serializable interface is just a marker, a way of telling the serialization code that your object does not contain file handles, database connections, or other such things that can't be safely serialized. Since I never put these things in my entities, I routinely mark all my entities as Serializable. I do not consider it a case of the web tier leaking into my domain model (I assume this is what you meant by "modified by the web tier"). jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: am I doing right? entities no Serializables.
I try to spend the less memory I can using LoadableDetachableModel. But if the user is filling up a form for a new entity I think I have two options, one serialize and the other create a kind of dto. I don't like the first because I don't want my domain model be modified by the web tier (Serializable interface) and I don't like the second because I prefer languages as Smalltalk, Grovee or Ruby which you don't need dtos either serializable interfaces. That's why I was speaking up. I like wicket and maybe I could find another way. ps: I am using db4o as my data object base (in this prototype). I know a guy who make wicket serialize their entities using db4o, but I don't know how hard is replace the serializable wicket mechanism. On Fri, Apr 18, 2008 at 7:30 PM, James Carman <[EMAIL PROTECTED]> wrote: > I like for my entities to always be serializable. Is there some > special requirement to have a non-serializable field on your entity > class? > > On Fri, Apr 18, 2008 at 4:50 PM, Fernando Wermus > <[EMAIL PROTECTED]> wrote: > > I am finishing my first app for production in wicket. As any newbie I try > to > > make a side relevant non-functional problems to focus in which I > consider > > important. > > I was implementing Serializable in all my entities, but I have to change > now > > that. I ve done it using LoadableDetachableModel. But I couldn't do it > in > > some parts. When the user walks over a wizard to create an entity, I > just > > attached to the wizard a new entity and, finally I persist it in the las > > step. But, I have to change that now, because the entity is not > Serializable > > anymore. > > > > Which is the best way? > > > > I think it is attaching a model which have all the attributes needed for > the > > creation of the entity and at the end I have to copy the whole > information > > to my entity, doesn' it? (like I was doing with j2ee DTO :( ). Then I > have a > > modelForm of the view and my entities at the end of the steps. > > > > Is there a best approach to it? > > > > Bye! > > > > ps: sorry for my english. > > -- > > Fernando Wermus. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Fernando Wermus.
Re: am I doing right? entities no Serializables.
I like for my entities to always be serializable. Is there some special requirement to have a non-serializable field on your entity class? On Fri, Apr 18, 2008 at 4:50 PM, Fernando Wermus <[EMAIL PROTECTED]> wrote: > I am finishing my first app for production in wicket. As any newbie I try to > make a side relevant non-functional problems to focus in which I consider > important. > I was implementing Serializable in all my entities, but I have to change now > that. I ve done it using LoadableDetachableModel. But I couldn't do it in > some parts. When the user walks over a wizard to create an entity, I just > attached to the wizard a new entity and, finally I persist it in the las > step. But, I have to change that now, because the entity is not Serializable > anymore. > > Which is the best way? > > I think it is attaching a model which have all the attributes needed for the > creation of the entity and at the end I have to copy the whole information > to my entity, doesn' it? (like I was doing with j2ee DTO :( ). Then I have a > modelForm of the view and my entities at the end of the steps. > > Is there a best approach to it? > > Bye! > > ps: sorry for my english. > -- > Fernando Wermus. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: am I doing right? entities no Serializables.
In this case, yeah I think the best way to go is with a DTO. You could use a static Inner POJO class. cheers On Fri, Apr 18, 2008 at 5:50 PM, Fernando Wermus <[EMAIL PROTECTED]> wrote: > I am finishing my first app for production in wicket. As any newbie I try > to > make a side relevant non-functional problems to focus in which I consider > important. > I was implementing Serializable in all my entities, but I have to change > now > that. I ve done it using LoadableDetachableModel. But I couldn't do it in > some parts. When the user walks over a wizard to create an entity, I just > attached to the wizard a new entity and, finally I persist it in the las > step. But, I have to change that now, because the entity is not > Serializable > anymore. > > Which is the best way? > > I think it is attaching a model which have all the attributes needed for > the > creation of the entity and at the end I have to copy the whole information > to my entity, doesn' it? (like I was doing with j2ee DTO :( ). Then I have > a > modelForm of the view and my entities at the end of the steps. > > Is there a best approach to it? > > Bye! > > ps: sorry for my english. > -- > Fernando Wermus. > -- Bruno Borges blog.brunoborges.com.br +55 1185657739 "The glory of great men should always be measured by the means they have used to acquire it." - Francois de La Rochefoucauld
am I doing right? entities no Serializables.
I am finishing my first app for production in wicket. As any newbie I try to make a side relevant non-functional problems to focus in which I consider important. I was implementing Serializable in all my entities, but I have to change now that. I ve done it using LoadableDetachableModel. But I couldn't do it in some parts. When the user walks over a wizard to create an entity, I just attached to the wizard a new entity and, finally I persist it in the las step. But, I have to change that now, because the entity is not Serializable anymore. Which is the best way? I think it is attaching a model which have all the attributes needed for the creation of the entity and at the end I have to copy the whole information to my entity, doesn' it? (like I was doing with j2ee DTO :( ). Then I have a modelForm of the view and my entities at the end of the steps. Is there a best approach to it? Bye! ps: sorry for my english. -- Fernando Wermus.