David,
Sounds like you know where I'm coming from on this.
What got me was an attempt to write a Menu Loc for listing
all registered users on the site. The Template for this contains
a lift tag for a snippet in another class. I don't necessarily object
to the dependency on a snippet class, but this does lead to reuse
problems for my User MetaMapper.
/**
* The menu item for listing all users
*/
def listUsersMenuLoc: Box[Menu] = {
Full(Menu(Loc("listUsers", "listUsers" :: Nil, S.??("List
Users"),
listUsers, testLogginIn)))
}
def listUsers = Template({ () =>
<lift:surround with="default" at="content">
<h3>Site Users</h3>
<div id="entryform">
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Roles</th>
<th></th>
<th></th>
</tr>
<lift:ManageUsers.list>
<user:entry>
<tr>
<td><user:firstname /></td>
<td><user:lastname /></td>
<td><user:email /></td>
<td><user:roles/></td>
<td><user:actions/></td>
</tr>
</user:entry>
</lift:ManageUsers.list>
</table>
</div>
<hr />
<div id="user-edit"/>
</lift:surround>
})
On Aug 19, 3:08 pm, David Pollak <[email protected]>
wrote:
> Glenn,
>
> Lemme see if I can put together some abstractions that might help out.
>
> Thanks,
>
> David
>
>
>
> On Tue, Aug 18, 2009 at 4:58 PM, glenn <[email protected]> wrote:
>
> > I'm looking for some answers on best coding practices, particularly
> > when it comes to object reuse.
>
> > In a data-centric application, where the Sitemap is used to navigate
> > through your mapper entities, has anyone given much thought to the
> > object dependencies this can create.
>
> > In the case of page specific rendering with SiteMap, for example,
> > where should the Menu entries go - in their own
> > object, or should they stay with the MetaMappers. And what about the
> > templates, which can have dependencies on snippets, which reside
> > elsewhere.
>
> > In other words, it seems to me that good design requires managing the
> > chain of dependencies that an ordinary Menu entry may require. A
> > consistent approach is always best, and I admit that I don't have one
> > at present.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---