Re: Models, find/findAll and object programming

2006-09-01 Thread [EMAIL PROTECTED]

hmm the data arrays are just "formats" to exchange information between
controllers, functions etc.  you could refactor this to be
object-style, but imo this doesnt have much to do with OOprogramming.
cause the "real" objects in OOP are fixed entities (like the models
that we use in cake),  in real OOP you also pass data as being arrays,
because you need some sort of container that contains "chunks of
concentraded information" , not only the content, but also the
structure of these are very variable, and can't really be written down
in a class, which is the mother of objects.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Models, find/findAll and object programming

2006-09-01 Thread Tony

Thanks all ;)

I know of limitations of OO in PHP4. I "prefer" version 5 ... if I'm
able to choose not to use it :D

Bret writes :
"to override the core of
cakePHP's behavior and write code that takes cake's array format and
converts it to objects"

That's what I have done (adding some findOO method, calling find and
returning an instance). And it's not really hard to code. That's why
I'm so surprise it's not in the cake package yet.

But from now, I will wait for the 2.0 version, hoping those
functionnalities will be considered as important.  And for the time, I
will try to find some real OO solution online, like Rails.

Tony


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Models, find/findAll and object programming

2006-08-31 Thread Bret Kuhns

[EMAIL PROTECTED] wrote:
> So, yes [PHP4] does support OO programming.  It just doesn't do it well and
> in the truest since of the term.

Neither does PHP5... something like Java is a "true" OO language, PHP5
is still mostly procedural augmented with OO functionality.

But like Chris said... that doesn't help Tony any. The only thing other
than waiting for version 2 to come out is to override the core of
cakePHP's behavior and write code that takes cake's array format and
converts it to objects. Or he could just change the code all together
and make it output objects from the get-go. This, obviously, isn't a
great solution, but I can't think of something easier. It's not in cake
yet, so unless you put it there yourself you're just going to have to
wait.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Models, find/findAll and object programming

2006-08-31 Thread Chris Hartjes

Okay, you win.  But I don't think it really helps Tony fix the problem
that started this thread.   It's not a PHP 4 vs. PHP 5 issue, no
matter how many words you devote to telling me that PHP 5 is true
objected-oriented programming.  It's a style issue, and if Tony needs
to mix functional programming with object-oriented programming, who am
I to tell him what to do?

Obviously we can't expect Tony to sit around and wait for Cake 2.0...


On 8/31/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Not TRUE object oriented programming.  That is the whole revelation of
> PHP5 and why most frameworks aren't available to PHP4.  Sure it has it
> by being VERY careful in what you are doing.  But it still is
> cumbersome, prone to errors, and slow as compared to PHP5.  Which
> again, is why most frameworks cheap out to PHP5 only and aren't as
> ingenous as the CakePHP people to tackle the PHP4 challenge.
>
> So, yes it does support OO programming.  It just doesn't do it well and
> in the truest since of the term.  But again having to tackle having one
> method that automatically references PHP4 or PHP5 correctly is one
> distinction of CakePHP.
>
>
> >
>


-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Models, find/findAll and object programming

2006-08-31 Thread [EMAIL PROTECTED]

Not TRUE object oriented programming.  That is the whole revelation of
PHP5 and why most frameworks aren't available to PHP4.  Sure it has it
by being VERY careful in what you are doing.  But it still is
cumbersome, prone to errors, and slow as compared to PHP5.  Which
again, is why most frameworks cheap out to PHP5 only and aren't as
ingenous as the CakePHP people to tackle the PHP4 challenge.

So, yes it does support OO programming.  It just doesn't do it well and
in the truest since of the term.  But again having to tackle having one
method that automatically references PHP4 or PHP5 correctly is one
distinction of CakePHP.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Models, find/findAll and object programming

2006-08-31 Thread Chris Hartjes

Hold on there, cowboy.  PHP 4 does support object-oriented programming.

On 8/31/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Plus CakePHP works with PHP4 which doesn't support OO programming.  So,
> that limitation means that to keep CakePHP working for PHP4 and PHP5
> they would need to write a whole PHP engine to handle the differences
> at the PHP level and bring the true OO when PHP5 is used instead of 4.
>
>
> >
>


-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Models, find/findAll and object programming

2006-08-31 Thread [EMAIL PROTECTED]

Plus CakePHP works with PHP4 which doesn't support OO programming.  So,
that limitation means that to keep CakePHP working for PHP4 and PHP5
they would need to write a whole PHP engine to handle the differences
at the PHP level and bring the true OO when PHP5 is used instead of 4.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Models, find/findAll and object programming

2006-08-31 Thread Bret Kuhns

Tony,

I agree, the retuning of arrays doesn't support good object-oriented
practices. But arrays are extremely flexible and easy to work with in
PHP, so that's probably why the developers chose to use them in
CakePHP. Version 2 of Cake, however, is supposively going to completely
change the way models return data by using objects just as us OO
zealots prefer :) So stick with it and eventually cake will upgrade to
a more robust OO environment.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---