Choosing PHP for large projects

This is a discussion on Choosing PHP for large projects within the PHP Language forums, part of the PHP Programming Forums category; >From the points listed, the only thing that would > make a difference, with regards to the size of ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-14-2005
coolsti
 
Posts: n/a
Default Re: Choosing PHP for large projects

>From the points listed, the only thing that would
> make a difference, with regards to the size of the project, is the lack
> of namespace. If the project is written from scratch (i.e. not just
> gathering up a bunch of prototypes or separate projects), you plan
> ahead, and you are strict with your naming conventions (proper
> prefixing), then it is less of a problem, if at all.
>
> If you include more than one namespace, then you can still get name
> collisions.


I think the namecase issue can be overcome in PHP by using classes. This
is what I do, not specifically for the namespace issue, but to sort of
organize and encapsulate my code. If I have something that is an "entity",
such as a "project activity" or such, I make a class, and put all
functions that have to do with project activities (assessing the database,
arranging things to create output HTML tables, or parts of tables, etc.)
in that class. Then the function is called by instantiating an object

$myobject = new myobjectclass
$myobject->myfunction()

or a variable directly

$myobject->name

or if instantiation is not needed (to just access a function)

myobjectclass::myfunction()

In effect, one could create a class just to create a namespace for a group
of functions.

// SI
Reply With Quote
  #12 (permalink)  
Old 02-17-2005
Armando Padilla
 
Posts: n/a
Default Re: Choosing PHP for large projects

coolsti wrote:
>>From the points listed, the only thing that would

>
>>make a difference, with regards to the size of the project, is the lack
>>of namespace. If the project is written from scratch (i.e. not just
>>gathering up a bunch of prototypes or separate projects), you plan
>>ahead, and you are strict with your naming conventions (proper
>>prefixing), then it is less of a problem, if at all.
>>
>>If you include more than one namespace, then you can still get name
>>collisions.

>
>
> I think the namecase issue can be overcome in PHP by using classes. This
> is what I do, not specifically for the namespace issue, but to sort of
> organize and encapsulate my code. If I have something that is an "entity",
> such as a "project activity" or such, I make a class, and put all
> functions that have to do with project activities (assessing the database,
> arranging things to create output HTML tables, or parts of tables, etc.)
> in that class. Then the function is called by instantiating an object
>
> $myobject = new myobjectclass
> $myobject->myfunction()
>
> or a variable directly
>
> $myobject->name
>
> or if instantiation is not needed (to just access a function)
>
> myobjectclass::myfunction()
>
> In effect, one could create a class just to create a namespace for a group
> of functions.
>
> // SI



Yea PHP is decent for large projects. I would recommend you use PHP
MVC(model view controller). Use Smarty to seperate the content from the
php and use classes to isolate your functionality/business logic.

AP
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:23 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0