When I've got a lot of potential subclasses that come from one row (e.g., an
event), I find that it's best to have a converter on the DB model that will
render the immutable thing (e.g., event).

Another alternative is to use the findMap method that will allow you to map
each row into a thing.

On Fri, Jan 9, 2009 at 3:46 PM, Charles F. Munat <c...@munat.com> wrote:

>
> I don't see how you're any worse off if the model can render itself in
> one way. And if that way is a common standards-compliant way, such as
> rendering to XML, and you include semantic information, then you can
> layer any other layers you want on top to do the mapping to the 30
> different contexts.
>
> Saying that an object should know how to render itself to some
> universally recognized format is not the same as saying that that solves
> all rendering issues.
>
> Is there some shortcut to 30 different renderings that I'm missing, or
> do you have to do the work either way?
>
> Chas.
>
> Kris Nuttycombe wrote:
> > If you want to render a model 30 different ways in 30 different
> > contexts, it kind of sucks though, doesn't it?
> >
> > Or what if, shock horror, you don't know how the eventual system is
> > going to want to render the model (i.e., the person doing the rendering
> > won't be able to change the model code.) Not too uncommon, I don't
> think...
> >
> > Kris
> >
> > On Sun, Jan 4, 2009 at 9:58 AM, Michael <mike.sr
> > <http://mike.sr>@gmail.com <http://gmail.com>> wrote:
> >
> >
> >      > Also I was looking at the sample model source code (User,
> ProtoUser)
> >      > and saw presentation logic mixed in it. Shouldn't the business and
> >      > model logic be kept separated from the presentation logic or is
> there
> >      > a Lift strategy it?
> >
> >     Hmm, a model that can render itself ... That sounds like this crazy
> >     paradigm called object-oriented programming. Some radicals say it has
> >     some advantages over the more procedural style of MVC.
> >
> >     -- Michael
> >
> >
> >
> >
> > >
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to