FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Dynamic form generation
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Dynamic form generation [message #177925 is a reply to message #177888] Fri, 27 April 2012 13:16 Go to previous messageGo to previous message
Tony Marston is currently offline  Tony Marston
Messages: 57
Registered: November 2010
Karma:
Member
"Jerry Stuckle" <jstucklex(at)attglobal(dot)net> wrote in message
news:jn8r0c$iss$1(at)dont-email(dot)me...
<snip>
> The fact you don't even understand basic concepts like encapsulation makes
> your code crap.

It is *YOUR* understanding of encapsulation which is flawed, not mine. You
seem to think that there are only two ways of putting data into an object:
(1) Using a publicly accessible variable, as in $object->foo = 'bar';
(2) Making the variable "private" and using a setter, as in
$object->setFoo('bar');

You are totally blind to the 3rd option which is:
(3) Inject data via a method's argument, as in
$object->insertRecord($_POST);

Don't forget that $_POST is an array which can contain any number of values,
or even arrays of values. I can just as easily use the $_GET array, or even
an array which is created within another object. How the array is created is
irrelevant.

As $object represents a database table all the data going in and coming out
is a single array variable which can contain either any number of columns,
or any number of rows and columns. When data is passed around internally,
such as through the validation object, it is also passed in as a single
array variable. This means that I never have to unpick the array and use
separate setters for each component within the array.

Encapsulation is nothing more than: "The act of placing data and the
operations that perform on that data in the same class."

There is *NO* rule in the definition of encapsulation which says that I
*MUST* make all the properties private. That is "information hiding", not
"implementation hiding", and encapsulation was *NEVER* meant to mean
information hiding. Even Martin Fowler, the author of Patterns of Enterprise
Application Architecture says so. Is he not considered to be an "expert" in
your eyes?

There is *NO* rule in the definition of encapsulation which says that I
*MUST* inject data one value at a time using a separate setter method. If I
want to inject a collection of data as a single array then there is no rule
which says that I can't. If I want to inject the data as an argument on a
method call then there is no rule which says that I can't.

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Data injection problems
Next Topic: Do you want to develop PHP for the Web and make money
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 05:16:02 GMT 2024

Total time taken to generate the page: 0.06675 seconds