On 1/30/07, Ala'a Ibrahim <[EMAIL PROTECTED]> wrote:
>
> well, I'm with Ammar on the dependancy problem, but not on the "I see no
> point in making configuration an object", well i've been there, at some
> point, you might ned our configuation from an exterrnal sorce, so putting it
> in anobject is a goodpractise that would encapsulates whee is it comming
> from.


I agree, I do use configuration objects sometimes, or rather something a
little bit more abstracted/scoped (factories for configuration that returns
an instance based on the container). But I was commenting on the example
that Faisal sent, it's too simple to need an object, and the object is being
used exactly like an assoc. array. There's no scoping bonus here, if the
object identifier $CFG was already used, you already got an issue, exactly
like an array. There's no point in using an Object if an Array EXACTLY does
the same thing.

Abstracting the origin of data (if needed) is very useful, but an array can
abstract data a well, I see no difference between the following
$CFG = array ('db' => 'test1', 'dada' => 'test2' .... );
and the example.

But as Faisal said this is just a snippet, so my comment can be ignored :)

- Ammar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Jordan PHP Users Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/JoPHP
http://Jolug.org/
-~----------~----~----~----~------~----~------~--~---

Reply via email to