Agreed, I would also highly suggest looking at Sling Models as an option to make your code more strongly typed without requiring a rigid node type structure: https://sling.apache.org/documentation/bundles/models.html
On Fri, Nov 13, 2015 at 8:37 AM, Jason Bailey <[email protected]> wrote: > My opinions: > > Sling is really about being able to take a data set and present that data > in multiple ways. For the vast majority of use cases you should use the > existing node types and property values and you don't need to use a CND. > > A custom nodetype is useful if there is a need to perform some explicit > searching over a large set of data or if you absolutely require limitations > on properties that the existing nodetypes don't help with. > > Avoid trying to think of it in terms of other frameworks; Sling has its > own rhythm to it. You have a request that identifies a resource and then > that data is handed off to a renderer. Using as much out of the box > functionality will give you the greatest flexibility. > > > -Jason > > -----Original Message----- > From: Guillaume Lucazeau [mailto:[email protected]] > Sent: Friday, November 13, 2015 8:01 AM > To: [email protected] > Subject: Resource class vs CND > > Hello, > > I'm currently studying Sling for a project, to store "documents" > containing pages, and components (image, text, maps, graphs etc.) > > While it seems to fit our needs perfectly, I'm a bit struggling to learn > some basic stuff before presenting a POC to our team. > > My first question would be: on what criteria should I choose to manage my > resources using a class extending AbstractResource or a nodetype definition > in a CND file? Do you have advice on it? I'm tending to use a class to keep > everything in Java, but I'm wondering if it's more/less/equally flexible, > and if it has drawbacks or benefits compared to a CND file. > > Thank you for every information you could give me > > Regards, > Guillaume >
