Re: PHP5 objects access/instantiation model (correction)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2007-07-11 at 12:50 -0400, Nathan Nobbe wrote:
> Robert,
> 
> I looked at your code in InterJinn a couple of times; i havent gone over all
> of it mind you but it looks pretty sweet.

It's very different in many respects from other styles of coding. It's
an MVC approach for the most part but the way libraries are accessed is
different than what I've seen elsewhere. In general class names are only
used in two places... when extending a class, and in the registration of
a class to a service. Instead classes are registered as
services/libraries and instances are retrieved by a general factory
mechanism that returns the instance based on the service/library name.
In this way almost all aspects of the framework can be overloaded, even
if they are core features, without ever touching the core code itself or
ever having to change class references within your code since you can
just register a different class for the service and all existing uses of
that service will now use the newly registered version. This was very
useful even before PHP5 got autoload (and even still IMHO) because the
loader would load the class's code on an as requested basis.

> have you had a look at any of the other frameworks i mentioned earlier in
> this thread?
> ez components

I work with a version of ez components on almost a daily basis
(pre-existing CMS that a client had set up) ... it makes me scream
because their template engine is godawful because it uses a block
approach that requires changing the PHP code if you move blocks out of
registered nestings. It's absolutely horrible. The code for the classes
is generally disgusting also, but that's just my opinion. Fortunately, I
was allowed to hook in InterJinn as needed and so new stuff uses the ez
components framework bu generally punts the work to InterJinn modules /
services / and templates. We've found run time speed to be much greater
for those modules and the maintainability of the content is much, much,
easier.

> , onPHP, and now there is a new one ive found (in recent
> thread) Radicore.  i really like the xsl approach
> for templates.

XSL is nice, but it's complex for the average Joe content developer.
When I created InterJinn I wanted something with similar capabilities
but without the restriction of well-formed-ness for the HTML content in
general (so that existing content could still be adapted with minimal
disruption - my new site is XHTML strict). So I created custom tags that
can wrap well-formed or not-so-well formed content and process as
necessary. Generally speaking though the template engine isn't in any
way limited to just custom tags, it can include anything since it's
pluggable and extendable. Also, unlike most other template engines,
TemplateJinn compiles to the actual PHP code the web server loads, so
there's no run-time hit, and in fact, there can be a run time bonus on
some aspects. For instance headers, footers, etc, etc can be punted to
separate templates but at compile time they are brought together to
create the final page. That's not to say TemplateJinn can't be used at
run-time, it can be, and it is in the case of the ez components hooking
since ezcomponents uses a front end loader.

Cheers,
Rob.
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux