Parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Folks,

I am thinking of putting together a class to handle passing parameters to a class. Basically when you define a class you would define your class to extend the parameter class. The parameter class would be JSON compliant so in the end when you call a class it you could pass the parameters as a JSON string.
(rough) eg.

myClass("label:test,title:this is text");

the parameter class would allow you to do something like:
echo  myClass->get("label");

The advantages are:
- You don't have to have a declaration for every variable used within your class - I could make the parameter class case independent (I know I need a flame suit for this but case dependency get on my nerves) - I can wrap a lot of functionality into the parameter class, stuff like 'ifNotNull("label") .......'

So far disadvantages are:
- Eclipse etc. has code completion, which means all the parameters you pass to a function can be presented to the developer as part of "code completion"

I'd like to know:
- Have any of you guys already done something like I am talking about.
- As developers do you reckon losing code completion is worth the advantages of a parameter class
- Have I overlooked something major ?

Let me know what you think,
 JC


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux