On 6/15/06, Dave Johnson <[EMAIL PROTECTED]> wrote:
Thanks for the feedback. Lots of good suggestions there.
On 6/14/06, Allen Gilliland <[EMAIL PROTECTED]> wrote:
> I think this looks good and will be a give improvement over what we
> currently have. Here's a few notes/comments ...
>
> 6. You have a section called "Changes to existing POJOs" where you list
> new methods to be added. This is the part I disagree with the most so
> far. I don't think those methods should be added to our existing POJOs
> because they are not related to the domain model in any way, they are
> only related to the way we render our UI. I would much prefer to see
> these methods be added to a class which extends the current pojos. This
> also has the benefit that we don't need new methods for some things like
> getTransformedText(), instead I think we should just override the
> default pojos getText() method to return the transformed text.
Yes. I like the idea of extending the POJOs. I'll update the proposal.
On second thought, I'm not sure about this one.
First, the new methods are related to our domain model. No matter what
your context is, if you are calling the Roller interfaces and dealing
with POJOs you're going to want to do things like getTransformedText()
to get the plugin processed version of the entry. Transforming text is
not part of the editor UI or the renderer UI, it's an operation that
the entry should provide. For example, if you're writing a command
line utility that calls the Roller interfaces to perform a system
backup or weblog export, you'd need that method.
Second, how do we go from a list of WeblogEntryData objects returned
by the backend to a list of wrapped WeblogEntryDataEx objects? Do we
do a copyFrom operation for each object? Do we extend the wrapper
instead? Or do we just map the extended WeblogEntryDataEx object via
Hibernate and persist it instead? Those aren't really appealing
options.
I don't like mixing UI into the POJOs either and I don't want to
introduce any dependency on Servlet API or Struts or Velocity, but
there are cases where POJOs need to know URLs and cases POJOs should
be expected do rendering-related things (i.e. getTransformedText()).
- Dave