Parameter

This is a discussion on Parameter within the PHP General forums, part of the PHP Programming Forums category; Hi Folks, I am thinking of putting together a class to handle passing parameters to a class. Basically when you ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-12-2008
John Comerford
 
Posts: n/a
Default Parameter

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

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 01:28 AM.


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