Hi Jeff, This is an interesting question and I'm also curious to see how others handle this case.
To me, it seems fine if the Web representation of the resource "thread number 3 of the help forum" contains navigation data and other contextual help. This is just how you "represent" your resource on a Web page. The same resource could expose a more focus XML representation for programmatic clients. Now, in term of coding, your ThreadResource class should have access to all the domain objects (POJOs) required to return the Web representation: Thread, User, Connections, etc. Best regards, Jerome > -----Message d'origine----- > De : Jeff Walter [mailto:[EMAIL PROTECTED] > Envoyé : mercredi 11 avril 2007 06:19 > À : discuss@restlet.tigris.org > Objet : Question to all about visual webapps and Restlet > > Hey All, > > Little philosophical/architectural question here... > > I'd like to know how many other people are using Restlet to > build visual web applications, and how they feel about > aggregating resource data on their pages? > > Let's take a simple example: > > We have a Resource for a thread on a forum: > http://somesite.org/forums/helpforum/threads/3 > > On this page, we display the thread Resource, but we also > want to show in a sidebar, lets say other online users > browsing the help forum, and the latest 3 posts to the help > forum (the actual data is unimportant, but the fact that the > data is not a part of the single thread Resource is). > > In Restlet, accessing this URL would load up a Thread > Resource and pick its HTML representation (let's say using a > Freemarker template). To display the extraneous data in the > sidebar, the Thread resource is going to have to access other > Resources information to then pass to the template. > Additionally, if this forum requires that a user be logged-in > to participate in discussions, the header on the page might > contain a "logout" link if the user is logged in (or "login" > link if they weren't already logged-in). > > Having "extraneous" information on a web page is pretty > common requirement, but it seems to not "feel right" to me in > terms of Resource implementation in Restlet. How do people > feel about Resources loading the extra Resource data to feed > to the templates? Is this just par for the course and > necessary? Are there best practices people like to employ to > accomplish this without feeling like you are defeating the > nice separation of Resources the framework creates for you? > > Any thoughts would be appreciated... just wanted to hear some > ideas/start a discussion. > > Thanks! > > Jeff > > > >