[Catalyst] Program the logic

Eduardo Oliveros eduardo.oliveros at gmail.com
Thu Jun 29 18:11:21 CEST 2006


> > Anyway, the question is just what is the best practice to program the
> > logic and test it before link the logic with the web application?.
> > (using the classes generated by the Class::DBI or whatever plugin).
>
> I'd stick to the fundamental OO Pattern theory: program to interfaces
> not implementations. Personally, I have my Controller actions call
> operations from a Model class interface and my aplication logic stays
> in the Model, behind the interfaces I defined. That way, I can test
> the aplication logic independently with unit tests and later on, run
> integration tests by mocking context objects.
>
That's exactly what I want to do.

But what I see is that using the generated classes by the plugins from
the application logic (what I call the model, but I see there is some
controversy :)) could be a bit tricky. Because Catalyst provides an
encapsulate environment where, for instance, you can start using all
the classes without need to use "use"...  (I mean: you don't need to
declare the classes that you are going to use).

I'm realising that you can "use" the classes from the application
logic and that's all... no major problem. :)

..............
What I understand by MVC:
The Model for me is in charge of managing the information, not just be
an abstraction of the DDBB or the data in general. The logic of your
application.

The Controller controls the interaction with the user. It works as a
middleman between the web and the model (the core of your application)
and the view.

And the View I think is clear. the HTML pages, program interface,...

Regards,
   Edu

PD: Anyway, Catalyst is a great framework to develop web applications,
it's just that the interpretation of the M in MVC is not the same.



More information about the Catalyst mailing list