note 105630 added to language.types.object

From: Date: Fri, 02 Sep 2011 05:00:42 +0000
Subject: note 105630 added to language.types.object
Groups: php.notes 
Request: Send a blank email to php-notes+get-182894@lists.php.net to get a copy of this message
In my mind, we phper can thorouly throw away the concept of Object(class instance), we only need Array and Mode Class: All arrays in initial mode support any array function as it's method: <?php $array1->array_flip(this); ?> Use "->mode()" to validate the minimal data set, and then switch mode class: <?php $array1->mode('class1', $success); ?> Any mode class has no "->construct()" in it, but has "->validate()" to validate the minimal data set. The array in a mode still could use array function as its method, but after using any of them the array will be switched back into basic array mode, and we need to use "->mode('class1', $success);" to switch mode back. The radical thought is data-centric programming, we need seperate the data(array) and the actvity(class method). We could modify php engine, to get rid of parts of OO(object oriented), and support Mode Class, we could call it MyPHP. For example: $arr_man1 could be set into two modes:cls_normal_man and cls_crazy_man: <?php $array_man1->mode('cls_normal_man')->normal_method1()->mode('cls_crazy_man')->crazy_method1(); ?> ---- Server IP: 208.69.120.55 Probable Submitter: 124.74.79.22 ---- Manual Page -- http://www.php.net/manual/en/language.types.object.php Edit -- https://master.php.net/note/edit/105630 Del: integrated -- https://master.php.net/note/delete/105630/integrated Del: useless -- https://master.php.net/note/delete/105630/useless Del: bad code -- https://master.php.net/note/delete/105630/bad+code Del: spam -- https://master.php.net/note/delete/105630/spam Del: non-english -- https://master.php.net/note/delete/105630/non-english Del: in docs -- https://master.php.net/note/delete/105630/in+docs Del: other reasons-- https://master.php.net/note/delete/105630 Reject -- https://master.php.net/note/reject/105630 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#182894) next »