[Catalyst] Model Instances vs. Model Classes - Round 2

Eden Cardim edencardim at gmail.com
Wed May 18 16:48:37 GMT 2011


>>>>> "Octavian" == Octavian Rasnita <octavian.rasnita at ssifbroker.ro> writes:
    Octavian> If you pass the context $c to the business model, and the business model
    Octavian> would need to access the attributes and methods offered by $c, then you
    Octavian> won't be able to use that business model outside of Catalyst because you
    Octavian> won't have the context variable available.

Technically, that isn't true. Given this is perl, we don't have implicit
type-checking, so you can always use duck typing, ie, build a class that
mimics all the methods available to $c and sons. The real issue is that
your API will be laden with web-based semantics, not business
semantics. The focal point of me bringing this up is that the
implementation is barely what matter in a discussion like this, it's
always about the API semantics.

-- 
   Eden Cardim       Need help with your Catalyst or DBIx::Class project?
  Code Monkey                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://blog.edencardim.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list