Slashdot Mirror


User: __aawpnr5477

__aawpnr5477's activity in the archive.

Stories
0
Comments
2
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 2

  1. Re:Unique Selling Points on Ask Sam Greenblatt About CA's $1 Million Open Source Prize · · Score: 1

    I don't know of any other open source databases that support either clustering (maybe Postgres 7.5, but that aint out yet) or parallel query processing.

  2. Re:The code is the data! on PHP Usage in the Enterprise · · Score: 5, Insightful
    I used PHP extensively for a number of years and finally wrote my own framework. In the end it turned out to be very much like some of the Java frameworks out there.

    IMHO the good parts about PHP are also the bad parts. ie, * you don't have to say what type a variable is, but that means you can't specify a type of parameter to a function. * you don't have to specify scope, but then you can't protect functions that should be private etc.

    I looked at a lot of Java code for ideas on what I could do with PHP to clean it up . The main things that I did were: set up a 3 or 4 tier architecture.

    • database abstraction layer
    • business layer
    • presentation layer (preferably using templates)
    (I modeled a lot of this on Enhydra - www.enhydra.org)

    never use globals. Wrap up the HTTP_GET_VARS, HTTP_POST_VARS etc in a class (ie Request). Create classes to wrap the server vars and whatever else.

    Use classes for everything. This gives you a reasonable amount of namespace control.

    Never access variables directly in classes. Create accessor methods for them.

    I think that if you are feeling the need to structure your PHP, you will probably need to move towards Java or some other more structured language. It can definitely be more challenging to write, but as your applications get bigger, the compiler-enforced type checking, programatticaly enforced/supported interfaces etc will save you a lot of time in the long run.