[Catalyst] General Web- and OO-question

Andreas Mock Andreas.Mock at web.de
Fri Mar 27 13:10:07 GMT 2009


Hi all,

as I've started to look at catalyst I wanted to ask how you or catalyst solves the following problems
in a "correct" oo-manner.

Szenario: I want to instanttiate a complex object of a class. This object does have many required
attributes and several other rules. The knowledge of these restrictions is lying in the object's class.
(IMHO this is the right place.)

In a web app these attributes are asked on more that one web page. (e.g. multitab/assistant).

My questions:
a) Where do I store the intermediate values of the attributes. I can't put them in the object itself
as it would generate a "invalid" object. Do I store them simply as data somewhere else? Do
I have to create a "proxy" object with lighter rules?

b) How can I verify attribute rules as early as possible in that "entering" process? Do I have to
dublicate the knowledge of the rules outside the class? (e.g. Length of String attribute less than 20)
The class itself would check such a restriction.

What ways are you going? Which is the "right" OO-way of doing it?

At the moment I really don't know where to place the input validation knowledge and where and how
to store the partly created objects. I hope it sounds not to academic, but I want to clearly seperate
the responsibilities.

Best regards
Andreas




More information about the Catalyst mailing list