Many thanks Dan, My Report class does similar to PdfRenderService & XlsGenerationService etc, I should probably spilt it into separate classes, with adapters for each platform (seam, jsf, servlet...) I could then see generation & customisation of layouts working in a similar way to Facelets Views, so will give it more thought.
Might there be a better name for it than "view model" btw? Mike ( iPhone) On 14 Dec 2010, at 19:22, Dan Haywood <[email protected]> wrote: > Hi Mike, > Sorry not to reply sooner. Thought I'd pick this thread up from your > original question. > > On 09/12/2010 17:41, Mike Burton wrote: >> To improve my understanding of Isis and to establish new potential features, >> I'm adopting a "devil's advocate" approach by looking at features I add to >> my projects and asking "can (or should) Isis do this" >> >> In this way I thought of _reports_, with filtering, sub/totals, and output >> to PDF/ CDR/ XLS. >> The data to report on may be Domain Objects, or joins / query results >> (perhaps "ViewModels" ie similar to "Views" in database parlance.) >> >> How would Isis approach this? > The way we've done this sort of thing on the big Irish project is to either > extract information out of the domain objects themselves, or to create a > "view model" that aggregates relevant information into a single transient > (never persisted) object. We then hand this raw information off to an > injected domain service, which does the actual work of generating the PDF, > XLS etc. > > For example, for sending out letters we have a FormCommunication (this is the > view model). This references a Customer, some of the relevant relationships > of that Customer (eg spouse/child etc), Benefits and so on. We then use the > XmlSnapshot capability (see either my book or the new applib documentation, > chapter 12) to generate XML. From this we can do whatever: apply XSLT, use > Xpath to extract info, etc etc. > > So... is there functionality missing from Isis? Well, only insofar that'd > it'd be nice to have a bunch of these domain services (PdfRenderService, > XlsGenerationService etc) available for reuse. This'd be a nice project for > someone to pick up. I was thinking that eventually these precanned domain > services might live under trunk/domain/services (you'll notice a placeholder > in the maven modules page on the wiki [1]). > > HTH, > Dan > > [1] https://cwiki.apache.org/confluence/display/ISIS/MavenModules > >> >> Best regards >> >> Mike Burton >> >> >> >> >>
