|
From: Stephan B. <s.b...@hc...> - 2006-10-20 12:56:29
|
Owen van Dijk wrote: > Hi All, > > I only see VO's used in the framework when using events to force > strict type checking. Is it a possible solution to provide a generic > VO class in the org.asapframework.data package? > > Hi Owen, The basic answer is no. A ValueObject class contains only data. Therefore, a generic ValueObject class would be empty, since it can only be generic if it doesn't already contain data. And in my view, an empty class is not very useful. But maybe I understand your question differently than you mean it? The VO classes that I have encountered, are so project-specific that they can't be generalised. Only when they are required by a class that we want in the framework, we will put a specific VO class into the framework. For example: The MovieManager uses the class org.asapframework.management.movie.MovieData internally for data storage. The upcoming release will however provide functionality for easier dealing with VO classes in combination with loading data as XML. There will be an interface IParsable that VO classes can implement, and that will allow them to get their data from a Parser. This Parser class is fed with data from XML2Object. There will also be a DataLoader class that allows you to load XML with or without POST parameters. This new package greatly reduces the number of lines needed to go from XML to typed VO classes, and makes the whole process a lot better maintainable. I hope this answers your question? Greetings, Stephan |