Re: [PHP] Architecture patterns in PHP
- From: mlemos@xxxxxxx (Manuel Lemos)
- Date: Tue, 30 Dec 2008 19:33:39 -0200
Hello,
on 12/30/2008 04:27 PM Nathan Nobbe said the following:
To be fair cake did "cache" the show tables/describe magically for aI was following the blog tutorial on cake and here's what I got fromA good framework will allow you to replace the introspection step with a
hitting the post/index page:
081230 12:51:55 316 Connect root@localhost on
316 Init DB cake
316 Query SHOW TABLES FROM `cake`
316 Query DESCRIBE `posts`
316 Query SELECT `Post`.`id`, `Post`.`title`,
`Post`.`body`, `Post`.`created`, `Post`.`modified` FROM `posts` AS
`Post` WHERE 1 = 1
316 Quit
static definition of the database table, thus easily bypassing the extra
queries. Although, I can't fathom why they've requested all the tables.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
few seconds if I sat there refreshing the page. :)
I always generate my Gateways & VO's from table definitions &
hand-code any non-crud statements. I've never really dealt with this
stuff before but it is a little disheartening. I would rather take
the 5 minutes re-generating a few files for an updated table versus
infinite amounts of computer power wasted trying to just make it work.
which bodes really well for something like symphony, but im not sure how
bulky the orm abstraction layer is. that could end up ruining it in the
end..
I think that part of the problem here is that those so called ORM
solutions are in reality ROM because they depart from the relational
data model to the object model. Since they do that dynamically, even
when they cache the results of reverse engineer the object model from
the database table structure, there is always some overhead reading
class structures from cache and rebuilding objects.
This article talks precisely about that problem.
http://www.phpclasses.org/blog/post/82-PHP-ObjectRelational-Mapping-ORM-or-ROM.html
Personally I use a code generation based solution named Metastorage. It
lets me defined my object models statically and then it generates
efficient code for the classes that store and retrieve the application
data objects.
http://www.metastorage.net/
This allows more flexibility and productivity than most ActiveRecord
based approaches, as it supports complex object models with
relationships, validation rules, etc..
Then Metastorage generates smart code that only does what you need.
There are no fat base classes to extend, nor ORM runtime libraries to
include. The generated code is self-contained, i.e. it does all that is
necessary without runtime libraries to add overhead to the execution of
the applications.
In cases that it is not necessary to use persistent objects (because the
objects are not going to be changed), like for instance listing data or
sending newsletters, Metastorage provides the concept of report classes,
i.e. classes that just retrieve data for read-only purposes. It is much
more efficient than using whole persistent objects because it only
retrieves the object variables that you need into arrays.
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
.
- References:
- Architecture patterns in PHP
- From: "Michael C. Yates"
- Re: [PHP] Architecture patterns in PHP
- From: Sancar Saran
- Re: [PHP] Architecture patterns in PHP
- From: Manuel Lemos
- Re: [PHP] Architecture patterns in PHP
- From: "Nathan Nobbe"
- Re: [PHP] Architecture patterns in PHP
- From: "Eric Butera"
- Re: [PHP] Architecture patterns in PHP
- From: "Nathan Nobbe"
- Re: [PHP] Architecture patterns in PHP
- From: "Eric Butera"
- Re: [PHP] Architecture patterns in PHP
- From: Robert Cummings
- Re: [PHP] Architecture patterns in PHP
- From: "Eric Butera"
- Re: [PHP] Architecture patterns in PHP
- From: "Nathan Nobbe"
- Architecture patterns in PHP
- Prev by Date: Since I speak with some of you more than people I see in person....
- Next by Date: Re: [PHP] PHP telnet server
- Previous by thread: Re: [PHP] Architecture patterns in PHP
- Next by thread: Re: [PHP] Architecture patterns in PHP
- Index(es):