ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

The Yii PHP Framework

<< < (4/5) > >>

f0dder:
Now there is nothing to stop you from doing low level efficient manual database querying, so you can always drop down to that when you need it.. Yii does use some fancy lazy-loading functionality which an be helpful -- but again it makes it hard to know how many queries are happening behind the scenes, etc.-mouser (July 17, 2011, 08:10 AM)
--- End quote ---
Does it have any diagnostics (like RoR) that shows generated SQL sentences and time spent executing queries?

And what's it's ActiveRecord querying like? Fluent OOP PHP calls, limited functions, or something string-based?

mouser:
You can read more about Yii's active record stuff here:

* http://www.yiiframework.com/doc/guide/1.1/en/database.ar
* http://www.yiiframework.com/doc/guide/1.1/en/database.arr
Some of this stuff is definitely inspired by Ruby-on-rails stuff, but i don't know enough to speak intelligently about that.  Php and mysql do have their own tools for checking expensive queries etc., i don't think yii has anything extra for that.  But it does have function to help you see exactly what it IS doing behind the scenes.

f0dder:
Thanks for those two URLs - it looks mostly sane, but...
'joinType'=>'INNER JOIN',
...
'order'=>'posts.create_time DESC'
--- End quote ---
(which looks a lot like RoR AR) hints that it's probably a very thin layer above SQL... There's two reasons this makes me go 'meh':

1) magic constants are bad, especially strings. And it {w,sh}ouldn't have been hard incorporating ascending/descending in the fluent API (LINQ does it).
2) a thin layer above SQL is likely to not add optimizations that a proper expression tree API can do... which leads to fine performance for toy applications, but having to resort to hand-written (and vendor-specific) SQL when you hit medium-sized sites, rather than being able to use a fluent API well into the medium-size sites.

Note that the performance comment is just an educated guesstimate - Yii's AR implementation could easily be better, haven't looked at it :)

mouser:
Well like i said it has some interesting stuff about lazy loading/saving -- especially for relations.  Which is quite appealing but i tend to view stuff like that with some suspicion in terms of performance.

My assumptions generally work like this: Don't trust such high-level abstractions when performance is really an issue (large databases, etc.), and so make sure you are using something that will let you go to low-level database access when you need it.  I think yii strikes a pretty good balance there.

jpprater:
I spent quite a bit of time this year looking at Python frameworks -- hoping to switch from php web development to python web development -- but concluded that at the current time, deploying python web applications is a total joke and a catastrophe for anything other than a scenario where you are running a single python web application on a server.  I also didn't fall in love with Django, Pylons, or the other major python web frameworks.
-mouser (April 20, 2011, 04:53 AM)
--- End quote ---
I personally would recommend the web2py framework for the Python side.  It's simple and easy to set up, and I've deployed both the framework and actual apps written for web2py in real-life situations.  It's painless, if you use the framework's packaging features.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version