[Catalyst] ways to do stuff and why

leonard.a.jaffe at jpmchase.com leonard.a.jaffe at jpmchase.com
Fri Aug 18 19:15:12 CEST 2006

Leonard A. Jaffe      (614)213-4283
JP Morgan Chase,   DTS Instrumentation Services
leonard.a.jaffe at jpmchase.com

Matt S Trout <dbix-class at trout.me.uk> on  08/18/2006 12:33 PM:
> Eeeeek, not at all. The model should encapsulate *all* business logic 
> similar - it should be a model of the domain with which the app 
interacts. The 
> Controller should be as thin a layer as possible whose sole purpose is 
> arbitrate between the model's view of reality and the user interface 
(i.e. the 
> view)

I disagree.

In an MVC sense:
The model is the data.
The controller is the business logic. 
The controller receives commands from the user interface, and manipulates 
the models.
The models are then displayed via views

The model insulates the controller from the data storage/retrieval 

The controller should be useable via any interface (command line, gui, 

If you want to talk about object composition...

I like for there to be one set of classes that represent the data, 
and encapsulate persistence, like (DBIC, CDBI, homegrown, etc).

I like a layer around those,  representing the domain objects
(contracts, users, invoices) which implement the manipulation of the 

Then I like objects that encapsulate the business processes, to manipulate 

the domain objects (new invoice, delete user) . I like objects, but
sometimes I just write functions, because object purists end up with 
and then they tell the 3 object to add itself to another three object, and 
that point, I'm curled up in the fetal position whimpering "primitives...I
want primitives"

It can all get very messy.  I strive for some kind of workable 
consistency, without
becoming dogmatic.


This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law.  If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED.  Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060818/281b84c2/attachment.htm 

More information about the Catalyst mailing list