Mail archive
acf

[Acf] [Fwd: ACF and OOP]

From: Nathan Angelacos <nangel_at_nothome.org>
Date: Wed, 06 Dec 2006 01:15:20 -0000

[for the records]

attached mail follows:



Hi,

I feel I *have* to write down what I have been thinking 2 weeks ago,
when I looked at the ACF stuff last time.

object.lua should probely be renamed to class.lua. Its a basic class
that does nothing else but enable several instances of a class (objects)
Strictly we don't need it, but I thought it might be good. (Its directly
copied from the PiL)

The CfObject class should be renamed to FrontController, or
FrontControllerClass. This is the generic front controller.

WebCfObject should be renamed to WebFrontController. It is a class that
inherits most of the methods directly from FrontController and just
add/replace the web specific stuff. This way, we can reuse the common,
shared, code if we create a CLI front controller.

cf = WebFrontController{ .... something ... }
will initialize cf as an instance of the WebFrontController class, with
its own private data.

This is the easy part. What we have today more or less.

I was thinking of removing all the html stuff in the webconf file and
let the controller execute the view. The controller has then also the
possibility to pick different view methods from the view module,
depending on in-data or results from model.

The *.view.lua can be an object that generates the html code from tables
in the way you described earlier with header, preamble, menu, contents,
footer etc.

I am also thinking of generating the contents from a table the way you
did the controller stuff (that plovs liked so much and started to use).
The difference would be that this code is in the view module and not in
the controller.

I'm wirintg very quick and long time since I actually looked at the
code. (I dont even know if you have commited new things to the ncopa
branch)

Re SVN. What if we create a new branch named oop, then we move the
useful things from ncopa branch and trunk. When we have oop branch
working at the level trunk is today we replave trunk with oop branch.

What do you think about that?
Received on Wed Dec 06 2006 - 01:15:20 GMT