[geeklog-devel] Release Candidate for MVC package
tony at tonybibbs.com
Mon Apr 7 19:23:50 EDT 2003
On Mon, 7 Apr 2003, Vincent Furia wrote:
> Wow Tony. I have to say thanks. The MVC design pattern was a little
> confused in my mind, but this helped to clear things up. Guess all I
> needed was to see the code. It looks great. I have a few things to add,
> but I think this is a cool idea for GL2 (G2?).
Thanks! Also thanks for the bug reports, I'll check into them.
> Now I have some questions about using the MVC...
> 1. How will (could) this be used for plugins. I was looking forward to
> having a GeeklogPlugin class that all plugins inherit from (I forgot who
> suggested this first). Clearly it would also be a good idea for plugins
> to use the MVC as well. Have you given any thought to incorporating these
> two ideas? Is the answer obvious and I'm just slow on the ball today?
Well, use by plugins would be optional as I do not see a good way to
'force' plugins to use it. Because all GL2 content will be based on the
same module API, newbies will have a few prexisting examples of how to use
the pattern in their new module.
> 2. I don't feel like digging through Phrame's code also, could you
> describe the differences between your MVC code and theirs?
Well, they aim to be 100% Struts compatible. I didn't care to adhere to
that so when I found what I considered to be a few design flaws I moved on
them. Some example of design flaws:
1) No use of factory pattern so all actions and models were loaded into
memory when only a small few would be required in order to process the
2) Use of the PHP array configuration file was hard to read so I created
an alternate XML config file that is easier on my eyes and could be
eventually validated via a DTD.
3) Validation was put into the Phrame form object. To me this breaks the
OO concept of encapsulation. This is illustrated in the case when you may
have two very similar forms (i.e. GL's story admin and regular story
submit) that could use one validation routine. In Phrame you'd end up
copying a bunch of the same code. Of course this is how Struts does it so
I'm not sure if I'm being a bit arrogant by assuming my method is better
4) If you don't use PHP4 sessions in Phrame you can't use it. While I
have a few inconsequential references to the Session (mainly for passing
error messages around) I will be updating my package to eliminate the need
for it all together...of course all this despite GL2 is using a custom
PHP4 session handler.
Again, thanks for the input. Hopefully the light starts going off for
those of you who actually try using it.
Tony Bibbs "I guess you have to remember that those who don't
tony at tonybibbs.com hunt or fish often see those of us who do as
harmlessly strange and sort of amusing. When you
think about it, that might be a fair assessment."
More information about the geeklog-devel