PHP Classes

the better is to had between OOP and global

Recommend this page to a friend!

      PHP Classes blog  >  What Are PHP Classes ...  >  All threads  >  the better is to had between OOP and...  >  (Un) Subscribe thread alerts  
Subject:the better is to had between OOP and...
Summary:the better is to had between OOP and global
Messages:2
Author:José Filipe Lopes Santos
Date:2012-03-21 17:27:10
Update:2012-03-21 22:24:55
 

  1. the better is to had between OOP and...   Reply   Report abuse  
Picture of José Filipe Lopes Santos José Filipe Lopes Santos - 2012-03-21 20:32:26
Hi !

Very, very great article !
Congratulations ! :-)

Usualy i develop a somme complex applications, and by my experience, i think that is good to had OOP, but it has a lot of functions do not has a commom purpose, do be a classe !
Imagine that you need functions to these common tasks: normalize strings, get register id, get date and format of the parts, ... !

By other way, i commonly use constants (ex: define("DSN","oci://...")), and global arrays (ex: $months = array(1 => "Jan", 2 => "Fev" ...) )
I usualy create a directory only with configurations: commom constants and arrays

gradually i use more OOP unlike global functions and variables !
Example: the my class in this site for calendar picker :-)
It has so many uses in diferrent contexts and apps ... !
But i think that never do one app can be only OOP !

I had a lot of classes to submit, but i had to mutch busy, but since its posssible i submit then !

Bye

  2. Re: the better is to had between OOP and...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-03-21 22:24:55 - In reply to message 1 from José Filipe Lopes Santos
Good to know that you have migrated more global code to classes. That will help making them more reusable in your projects or projects of other developers.

Feel free to send your most useful classes when you have time, especially if they are innovative, as it may help you be nominated to the Innovation Award as you know.

phpclasses.org/award/innovation/