Hi,the models in my past applications were quite small and if they need interaction with other models (like DBIC and stuff), I used ACCEPT_CONTEXT to either get the complete context object or part of it. But all the models were related only to website parts and I didn't use them outside of catalyst. But, one goal of models should be to be able to use them without catalyst, e.g. in cron jobs or other scripts.
In a "proof of concept" app I'm building right now, I need the models to be usable outside, so I cannot rely on the context object to interact with other models and the database. My idea is to build the modules with business logic completly independent from catalyst and use the models as thin wrappers around them. With Catalyst::Component::InstancePerContext I'm able to construct these modules per request and pass the schema as parameter to new(), so the module could use the database for retrieving the required data. As the other models are only wrappers, too, I could just 'use' the other modules inside one module and pass along the schema, too.
I'm interested if this way of "modelling" is acceptable, how you achieved this and what is considered best practice.
Thanks, matt -- rainboxx Matthias Dietrich Freier Software Engineer rainboxx | Tel.: +49 (0) 151 / 50 60 78 64 Tölzer Str. 19 | Mail: [email protected] 70372 Stuttgart | WWW : http://www.rainboxx.de XING: https://www.xing.com/profile/Matthias_Dietrich18 GULP: http://www.gulp.de/profil/rainboxx.html
PGP.sig
Description: Signierter Teil der Nachricht
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
