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]
