Page 1 of 1

subschema copy

Posted: Fri Aug 07, 2009 2:54 pm
by ConvertFromOldNGs
by rob >> Sun, 16 Oct 2005 20:31:22 GMT

Methods are defined on the class to which they relate (encapsulation), but if the method is specific to a particular view, should it be defined in the model schema or the appropriate view schema (on a subschema copy class), e.g.

Transaction.displayForMarketingReport()
Customer.formatForBulkLoadTable()

I've seen subschema copy used for this purpose, but only very rarely. Is subschema copy all bad?

Thoughts appreciated ...

Cheers,
Robert

Re: subschema copy

Posted: Fri Aug 07, 2009 2:54 pm
by ConvertFromOldNGs
by Robert >> Thu, 20 Oct 2005 23:27:05 GMT

Okay, I'll answer my own posting, if no-one else will.

The following follows a discussion with a Jade authority ... the bottom line is that using subschema copy classes to define methods in a specific view schema is a sound practice. These methods are usually doing some formatting specific to a particular form or report, and should be named as such (as per above examples), so they don't prevent later addition of generic methods in the model schema.

Some background on subschema copy methods - in the past there were limitations when accessing objects across peer schemas - these underlying limitations were removed when packages were introduced.