* Avoid Object-Relational-Mapping tools such as Hibernate or iBatis, since PHP isn’t comfortable with ORM yet.
The claim: php is 70% as competent as java, in terms of OO features to model and design a system. I think it’s below 70%.
* polymophism, dynamic bind` @@
* strongly typed — fundamental to OO system design
* A java return type can be declared as an interface/abstract type, so clients can safely use an expected service of the interface
* inner class for OO design
* more access modifiers
* Constructor chain reaction up to Object@@
* custom classloader
* factory, singleton and other patterns
* java proxy to implement AOP
* distributed components — RMI, corba… important for some enterprise systems.
each object’s wait set
custom exception@@ yes
smarty is an extremely well-defined, simple and above all, concrete, implementation of many abstract concepts. Suprisingly, I used and studied struts many times more than smarty but I understand smarty better.
We can use smarty as a starting point or reference point to understand views in struts MVC.
In fact, jsp Expression Language and JSTL also mirror smarty.
* request object = a huge nested php object passed into smarty template
* afward = a logical name (no such thing in smarty) for a “physical” view
* forward request to a view =
* controller as request router =
similar to DBI/DBD — one vendor-independent component + one vendor-specific component
how PDO compares to other popular abstraction layers out there, for example, PEAR DB or ADODB. pdo is lighter than either of those, both in terms of API and in terms of performance.
mysql stored procedure is ok with pdo but not pear::db
Many folks resort to a data abstraction layer, such as Pear::DB or DBX. Using a data abstraction layer is a good thing, but its main goal is to make the RDBMS transparent, allowing you to change database vendors fairly easily.
Thanks. They did ask about xml, object-oriented php …
q: any object-oriented php framework you used, such as zend framework
q: what’s the object-oriented MVC architecture?
q: how object-oriented is the data access layer?
This xml question was tough, because they decided to drill down right to the limits of the interviewee’s understanding of a past project.
q: in your project, how did xml help flash-php integration.
—– Original Message —–
> Hi, how was your php interview? Guess you must have done it well. Did you meet any unexpected tough questions?
include vs require
how to define a class
xml functions, oo or otherwise
static property — same as a java static property
static var ] non-oo function. No java counterpart. consider it an abuse of “static”
static var not declared inside anything is private to the file scope.
[[practical c++ programming]] has a full list of meanings.
Evolution-wise, I think the closest thing before ror is “object-oriented MVC with smarty and PEAR::DB”, just like bracketology, which offers a unique entry point to the confusing world of ror.
“In Rails, if you have, for example, a BlogController and it has a method called list, Rails will automatically use the list.rhtml file inside of a folder called blog in your views folder. Not only that, but Rails will automatically pass on any instance variables you were using in the controller so that the view has access to them.
Now, when I am doing something similar in my own PHP apps, I have to manually instantiate the template object, manually pass references to any variables I know the view will be interested in and then manually tell it what template file to use. While all that manual code is pretty simple and easy to write, on even medium-sized apps it starts to take a toll on the leaness of the codebase.”
I think he’s referring to something similar to smarty. Looks like this “convention over config” slogan is one aspect of the evolution from smarty -> ruby-on-rails
Other ror innovations over php?
query cache ] pdo?
persistent db connection?
connect to a db cluster?
cluster between 2 php servers? with session failover?
php web server, static web server, proxy
Q: Remember the NBC invisible dual-host cluster with different date? How do you duplicate the sessions? Or you don’t because each session is needed only in one host due to session-based load routing?
db — incl persistent db connections (manual)
session — memorize the details
security — xss