473,890 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object Oriented PHP

I am new to PHP, just one day new. But I am otherwise a seasoned
programmer on many other languages like C, VB 6, C#, VB.NET, Win32
platform and have some tiny bit experience in MFC, C++, Python.

All the tutorials I read so far about PHP contain procedural examples.
I haven't yet come accross a tutorial on the object oriented PHP. Could
someone point me to one?

Jun 17 '06
73 4556

Henk Verhoeven wrote:
IMHO private declarations are too rigid and therfore decrease
reusability. I agree that it can be very usefull to know the intentions
of the developer of some code one is evaluating to call or some member
variable one is avaluating to access. But every now and then there are
good reasons to do it anyway, even if it was intended to be private. For
example lazy initialization and default reasoning both are often
implemented using direct access to member variables. Another example is
using a visitor to implement persistency.

Now maybe you would say that i should change these member variables to
protected or public. There are two problems with this:
1. It may not be my own code. Then if i get an upgrade of this code,
these member variables will once again be private, unless i re-apply my
changes. This is uneccessary overhead.
2. By changing the private declaration the intension of the other
developer gets lost. Now i could put a comment in that it was intended
to be private, but in that case: why not put the @private marker in the
comment in the first place?

The fundamental point is: With these private and protected declarations
you get stuck with the uneccessarily limitations introduced by the
author. Object-orientation can lead to more reusability then
conventional parameterized code exactly because the code can be
overridden and extended in ways the original author did not provide for.
private and protected declarations are a step backwards that is only
reasonable if you assume that future developers that will maintain or
reuse your code will ignore your intentions becuase they are fools. If
this is the case, i think you should tell your boss that you are
limiting the reusability of your code because you are aniticipating him
to hire fools and let them work on/with your code ;-)

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.


Its nice to see someone share this opinion (mostly). I agree that
private declarations are a hinderance more often than not. If I'm
going through the trouble of heavily extending a class, I will more
than likely need or want access to the member variables for ease of use
and efficency - and besides, you should be allowed to hack away at
things if you really want to; I think extending a class is a decent
enough prequisite that you're aware of whats going on.

One bad practice based on good intentions is code reuse when the
underlying implementation will pose a problem (ie, it uses a linear
search but you need something faster). Its a good reason to use
protected more often than private. Unfortunately, during my entire
education, I've never had a teacher mention protected other than in
passing, let alone encourage its use.

I have to disagree with not having public, though, it helps enforce
proper use of the class and prevent hack n' slash methods which are so
common in web development. You can encourage discipline and practice
all you want, but mistakes and disregard happens. Its safer to require
them to do it a certain way. Also, if you are using 3rd party packages
from pear or whatnot and they modify the underlying implementation,
then your code is broken or highly suspect. Getter and setter methods
can return a reference/pointer to the original data if they need to
access it directly, and they can have a ball with it then.

What would be nice is a mechanism for overriding protection by casting
or something. (unprotected) $this->data. Sorta like friend but not
requiring the declaration in the original source. I'm of the opinion
that if you're willing to cast something, then you're aware of the
implications it has and should be allowed to.

I think a distinction should be made between maintaining code and
reusing code. Maintaining means you're going to change it, reusing
means you're going to use whats already there, without modifying it.
If you're maintaining it, then yes, you should definately know what the
intentions are; you're probably going to be modifying the source in the
future.

(Aside: Chances are you're going to maintain some code and think 'Man,
what a fool.' Meanwhile, 'This guy's an idiot' is being thought by
your replace back at your old job. Just say no to Programmer Hubris.)

However, reusing code should not require an understanding on why the
author did what. Thats part of the purpose of OOP. So, HTML_Table
changed from using a complete associative array to a sparse linked list
matrix. Do I really care? I shouldn't have to.

Woo, my caffine rush just kicked in. I'm going to get some work done.

Jun 26 '06 #51
Tony Marston wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:7f******** *************** *******@comcast .com...
Tony Marston wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:tM***** *************** **********@comc ast.com...
Tony Marston wrote:
>"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
>news:ce*** *************** ************@co mcast.com...
>

<snip>

>OO is about encapsulation, polymorphism and inheritance. Message passing
>is incidental.
>
>
>
>
>>And YOU are the one "bastardizi ng" OO. Your sloppy approach to
>>programmi ng is just what *real* OO is designed to eliminate. And it
>>makes the coding much more maintainable, expandable and modifiable.
>
>
>Not the way some people use OO. They deliberately make it more
>complicate d than it need be, while I keep it as simple as possible.
>

And that is where you are 100% wrong. Message passing is an integral
part of both object-based and object-oriented languages.

One bit of wisdom, Tony. Tis better to remain silent and have everyone
thing you might be a fool than to open your mouth and remove all doubt.

In the OO world you have removed all doubt.
The three principles of OO are encapsulation, polymorphism and
inheritanc e. Message passing does not appear in that list, so it is a
minor detail.


And that's where you are totally wrong.

Excuse me? After performing a google search on OOP all I see quoted time
after time are the three basic principles - encapsulation, inheritance and
polymorphism - so how could I possibly be wrong?


Maybe if you check some sites which know what they're talking about - instead of
your own. Try some like:

http://www.fincher.org/tips/General/...edDesign.shtml
http://en.wikipedia.org/wiki/Object-...ed_programming
http://www.awprofessional.com/bookst...824191&redir=1
http://www.objectfaq.com/oofaq2/body/basics.htm

Just for starters.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '06 #52
Tony Marston wrote:

And the opinion of other experts in the field - such as the ones I
mentioned before.

Even experts disagree on what is or is not the *right* way in OO, so all I
am doing is agreeing with those experts who disagree with your your
favourite experts.


But NONE of the experts disagree on message passing. Check out what Booch,
Rumbaugh or Iverson have to say, for instance. Especially Booch - the founder
of OO techniques.
Your implementation violates some of the basic reasons for even having OO!
And no, I don't believe MY way is the only way. But I believe the experts
in the field know a hell of a lot more about it than you do.

I disagree. I am using the three basic principles of OO, as documented, to
achieve a higher level of reuse than I could by using non-OO techniques.


And you're missing the fourth principle.
I suspect you've had no real-world OO experience. Large, complex projects
OO is designed to make easier. All of your experience is probably simple
PHP pages you do yourself with no collaboration.

At least I have not been taught by people who don't know what they're
talking about.


So obviously you have no real world experience.
Your attitude would never survive in a the large scale projects I've been
involved in (100+ programmers, 2 years+ time). But then it wouldn't
survive the smaller projects I've been involved in, either - (i.e. three
programmers for two months).

The size of project is irrelevant. The OOP principles are the same
regardless of the size of project. The only project I have ever been
associated with which failed disastrously was one where the system
architects got carried away with their fancy ideas of how OOP should be
implemented and produced something that was so inefficient and unproductive
that the client cancelled the entire project as soon as the first live
programs were produced. It was THEIR attitude that was wrong, not mine.


If you had worked on something other than a 50 LOC web site you'd know that is
complete horse shit.

Just because some system architects didn't know what they were doing doesn't
mean OO is bad. It means only that they had no idea what they were doing.

For the record - since starting with OO in 1988, I've been involved in a number
of projects - small to large. And every project where people knew what they
were doing was successful.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '06 #53
Henk Verhoeven wrote:
Jerry Stuckle wrote:
> Actually, things like private declarations are very important.


IMHO private declarations are too rigid and therfore decrease
reusability. I agree that it can be very usefull to know the intentions
of the developer of some code one is evaluating to call or some member
variable one is avaluating to access. But every now and then there are
good reasons to do it anyway, even if it was intended to be private. For
example lazy initialization and default reasoning both are often
implemented using direct access to member variables. Another example is
using a visitor to implement persistency.

Now maybe you would say that i should change these member variables to
protected or public. There are two problems with this:
1. It may not be my own code. Then if i get an upgrade of this code,
these member variables will once again be private, unless i re-apply my
changes. This is uneccessary overhead.
2. By changing the private declaration the intension of the other
developer gets lost. Now i could put a comment in that it was intended
to be private, but in that case: why not put the @private marker in the
comment in the first place?

The fundamental point is: With these private and protected declarations
you get stuck with the uneccessarily limitations introduced by the
author. Object-orientation can lead to more reusability then
conventional parameterized code exactly because the code can be
overridden and extended in ways the original author did not provide for.
private and protected declarations are a step backwards that is only
reasonable if you assume that future developers that will maintain or
reuse your code will ignore your intentions becuase they are fools. If
this is the case, i think you should tell your boss that you are
limiting the reusability of your code because you are aniticipating him
to hire fools and let them work on/with your code ;-)

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.


Henk,

Private declarations are key to OO programming.

One of the basic tenets of OO programming is that you don't know the internals
of the object you're operating on (encapsulation) . You can then change the
internals of that object - and not affect any code depending on that object (as
long as you don't change the interface - the message passing). Contrast to
public variables - if you find you need to change one, it's hard telling how
many places you have to change it in the code.

For instance. Lets say you have a variable in your class containing a name,
which you access directly throughout your code. Now suddenly you find you need
to keep that as first name and last name - instead of just name. How many
places are you going to have to change in your code?

Contrast this with a GetName() function, which in the first case returns the
name field. When you change the code to have first_name and last_name, your
GetName() function just returns the concatenated fields (with a space between).
You have to make no changes in the rest of your code.

Second example. You have a Person class with a name. You reference it
directly. But now you find you need to split the class - you need class
Employee and class Contractor. Both can be derived from Person - but now
Employee doesn't have a Name. That's in the parent class Person. But while you
can't access Name in Employee, you can access GetName because that has been
inherited from Person.

Last example. You have a Date field in your class in the format of MM/DD/YYYY
(U.S. format). Someplace in your code you suddenly get "this is garbage" in the
field. Where did it come from? If the variable is private, a change to an
invalid value can be intercepted *before* the value is stored, and an error
message produced. Otherwise you may be hundreds of thousands of LOC later
before finding the invalid value.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '06 #54

"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:Te******** *************** *******@comcast .com...
Tony Marston wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:7f******** *************** *******@comcast .com...
Tony Marston wrote:

"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:tM**** *************** ***********@com cast.com...
>Tony Marston wrote:
>
>
>>"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
>>news:ce** *************** *************@c omcast.com...
>>

<snip>

>>OO is about encapsulation, polymorphism and inheritance. Message
>>passing is incidental.
>>
>>
>>>And YOU are the one "bastardizi ng" OO. Your sloppy approach to
>>>programm ing is just what *real* OO is designed to eliminate. And it
>>>makes the coding much more maintainable, expandable and modifiable.
>>
>>
>>Not the way some people use OO. They deliberately make it more
>>complicat ed than it need be, while I keep it as simple as possible.
>>
>
>And that is where you are 100% wrong. Message passing is an integral
>part of both object-based and object-oriented languages.
>
>One bit of wisdom, Tony. Tis better to remain silent and have everyone
>thing you might be a fool than to open your mouth and remove all doubt.
>
>In the OO world you have removed all doubt.
The three principles of OO are encapsulation, polymorphism and
inheritance . Message passing does not appear in that list, so it is a
minor detail.
And that's where you are totally wrong.

Excuse me? After performing a google search on OOP all I see quoted time
after time are the three basic principles - encapsulation, inheritance
and polymorphism - so how could I possibly be wrong?


Maybe if you check some sites which know what they're talking about -
instead of your own. Try some like:

http://www.fincher.org/tips/General/...edDesign.shtml
http://en.wikipedia.org/wiki/Object-...ed_programming
http://www.awprofessional.com/bookst...824191&redir=1
http://www.objectfaq.com/oofaq2/body/basics.htm

Just for starters.


I got my information from these sites:

http://c2.com/cgi/wiki?ObjectOriented
http://c2.com/cgi/wiki?PolymorphismE...ionInheritance
http://en.wikipedia.org/wiki/Object-...ed_programming
http://www.phpbuilder.com/columns/luis20000420.php3

All I see about message passing is that it is how one object communicates
with another. This is a trivial detail compared with encapsulation,
inheritance and polymorphism. Even non-OO languages can pass messages, so
what's so important about it?

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Jun 27 '06 #55

"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:Cb******** *************** *******@comcast .com...
Tony Marston wrote:

And the opinion of other experts in the field - such as the ones I
mentioned before.

Even experts disagree on what is or is not the *right* way in OO, so all
I am doing is agreeing with those experts who disagree with your your
favourite experts.


But NONE of the experts disagree on message passing. Check out what
Booch, Rumbaugh or Iverson have to say, for instance. Especially Booch -
the founder of OO techniques.


Message passing exists in non-OO languages, so it not something whch is
unique to OO.
Your implementation violates some of the basic reasons for even having
OO! And no, I don't believe MY way is the only way. But I believe the
experts in the field know a hell of a lot more about it than you do.

I disagree. I am using the three basic principles of OO, as documented,
to achieve a higher level of reuse than I could by using non-OO
techniques.


And you're missing the fourth principle.


Message passing is not unique to OO, and is not one of the fundamental
principles. It is simply the way that one object communicates with another.
I suspect you've had no real-world OO experience. Large, complex
projects OO is designed to make easier. All of your experience is
probably simple PHP pages you do yourself with no collaboration.

At least I have not been taught by people who don't know what they're
talking about.


So obviously you have no real world experience.
Your attitude would never survive in a the large scale projects I've been
involved in (100+ programmers, 2 years+ time). But then it wouldn't
survive the smaller projects I've been involved in, either - (i.e. three
programmer s for two months).

The size of project is irrelevant. The OOP principles are the same
regardless of the size of project. The only project I have ever been
associated with which failed disastrously was one where the system
architects got carried away with their fancy ideas of how OOP should be
implemented and produced something that was so inefficient and
unproductive that the client cancelled the entire project as soon as the
first live programs were produced. It was THEIR attitude that was wrong,
not mine.


If you had worked on something other than a 50 LOC web site you'd know
that is complete horse shit.


Excuse me? I have produced administrative web applications with over 500
components, so that puts me way beyond the 50 LOC web site.
Just because some system architects didn't know what they were doing
doesn't mean OO is bad. It means only that they had no idea what they
were doing.
But they were folowing allthe rules, so how could they be wrong?
For the record - since starting with OO in 1988, I've been involved in a
number of projects - small to large. And every project where people knew
what they were doing was successful.


If your techniques produce something that works, then you are obviously
doing something right. It is only when the software does not work that you
can say that the techniques were wrong. My techniques work, therefore you
have no cause to say that the are wrong.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Jun 27 '06 #56

"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:Ir******** *************** *******@comcast .com...
Henk Verhoeven wrote:
Jerry Stuckle wrote:
> Actually, things like private declarations are very important.
IMHO private declarations are too rigid and therfore decrease
reusability. I agree that it can be very usefull to know the intentions
of the developer of some code one is evaluating to call or some member
variable one is avaluating to access. But every now and then there are
good reasons to do it anyway, even if it was intended to be private. For
example lazy initialization and default reasoning both are often
implemented using direct access to member variables. Another example is
using a visitor to implement persistency.

Now maybe you would say that i should change these member variables to
protected or public. There are two problems with this:
1. It may not be my own code. Then if i get an upgrade of this code,
these member variables will once again be private, unless i re-apply my
changes. This is uneccessary overhead.
2. By changing the private declaration the intension of the other
developer gets lost. Now i could put a comment in that it was intended to
be private, but in that case: why not put the @private marker in the
comment in the first place?

The fundamental point is: With these private and protected declarations
you get stuck with the uneccessarily limitations introduced by the
author. Object-orientation can lead to more reusability then conventional
parameterized code exactly because the code can be overridden and
extended in ways the original author did not provide for. private and
protected declarations are a step backwards that is only reasonable if
you assume that future developers that will maintain or reuse your code
will ignore your intentions becuase they are fools. If this is the case,
i think you should tell your boss that you are limiting the reusability
of your code because you are aniticipating him to hire fools and let them
work on/with your code ;-)

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.


Henk,

Private declarations are key to OO programming.


No they are not. Encapsulation is not the same as data hiding. Please refer
to:
http://www.javaworld.com/javaworld/j...psulation.html
http://www.itmweb.com/essay550.htm

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
One of the basic tenets of OO programming is that you don't know the
internals of the object you're operating on (encapsulation) . You can then
change the internals of that object - and not affect any code depending on
that object (as long as you don't change the interface - the message
passing). Contrast to public variables - if you find you need to change
one, it's hard telling how many places you have to change it in the code.

For instance. Lets say you have a variable in your class containing a
name, which you access directly throughout your code. Now suddenly you
find you need to keep that as first name and last name - instead of just
name. How many places are you going to have to change in your code?

Contrast this with a GetName() function, which in the first case returns
the name field. When you change the code to have first_name and
last_name, your GetName() function just returns the concatenated fields
(with a space between). You have to make no changes in the rest of your
code.

Second example. You have a Person class with a name. You reference it
directly. But now you find you need to split the class - you need class
Employee and class Contractor. Both can be derived from Person - but now
Employee doesn't have a Name. That's in the parent class Person. But
while you can't access Name in Employee, you can access GetName because
that has been inherited from Person.

Last example. You have a Date field in your class in the format of
MM/DD/YYYY (U.S. format). Someplace in your code you suddenly get "this
is garbage" in the field. Where did it come from? If the variable is
private, a change to an invalid value can be intercepted *before* the
value is stored, and an error message produced. Otherwise you may be
hundreds of thousands of LOC later before finding the invalid value.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jun 27 '06 #57
Tony Marston wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:Te******** *************** *******@comcast .com...
Tony Marston wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:7f***** *************** **********@comc ast.com...
Tony Marston wrote:
>"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
>news:tM*** *************** ************@co mcast.com...
>
>
>
>>Tony Marston wrote:
>>
>>
>>
>>>"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
>>>news:ce* *************** **************@ comcast.com...
>>>
>
><snip>
>
>>>OO is about encapsulation, polymorphism and inheritance. Message
>>>passin g is incidental.
>>>
>>>
>>>
>>>>And YOU are the one "bastardizi ng" OO. Your sloppy approach to
>>>>program ming is just what *real* OO is designed to eliminate. And it
>>>>makes the coding much more maintainable, expandable and modifiable.
>>>
>>>
>>>Not the way some people use OO. They deliberately make it more
>>>complica ted than it need be, while I keep it as simple as possible.
>>>
>>
>>And that is where you are 100% wrong. Message passing is an integral
>>part of both object-based and object-oriented languages.
>>
>>One bit of wisdom, Tony. Tis better to remain silent and have everyone
>>thing you might be a fool than to open your mouth and remove all doubt.
>>
>>In the OO world you have removed all doubt.
>
>
>The three principles of OO are encapsulation, polymorphism and
>inheritanc e. Message passing does not appear in that list, so it is a
>minor detail.
>

And that's where you are totally wrong.
Excuse me? After performing a google search on OOP all I see quoted time
after time are the three basic principles - encapsulation, inheritance
and polymorphism - so how could I possibly be wrong?


Maybe if you check some sites which know what they're talking about -
instead of your own. Try some like:

http://www.fincher.org/tips/General/...edDesign.shtml
http://en.wikipedia.org/wiki/Object-...ed_programming
http://www.awprofessional.com/bookst...824191&redir=1
http://www.objectfaq.com/oofaq2/body/basics.htm

Just for starters.

I got my information from these sites:

http://c2.com/cgi/wiki?ObjectOriented
http://c2.com/cgi/wiki?PolymorphismE...ionInheritance
http://en.wikipedia.org/wiki/Object-...ed_programming
http://www.phpbuilder.com/columns/luis20000420.php3

All I see about message passing is that it is how one object communicates
with another. This is a trivial detail compared with encapsulation,
inheritance and polymorphism. Even non-OO languages can pass messages, so
what's so important about it?


Gee, and wiki's are the Last Word? ROFLMAO! Try some real experts - like
Booch, Iverson and Rumbaugh, for instance. These guys have been recognized as
experts throughout the world for upwards of 20 years - instead of some guy who
posted in a wiki.

However, wikipedia (which I also mentioned because it might meet your level of
intelligence), says under "Fundamenta l Concepts":

"Method (also known as message) — how code can use an object of some class. A
method is a form of subroutine operating on a single object. Methods may be
divided into queries returning the current state and commands changing it: a Dog
could have a query Age to say how old it is, and command chase (Rabbit target)
to start it chasing a rabbit. A method may also do both, but some authorities
(e.g. Bertrand Meyer) recommend they be kept separate. Sometimes access to the
data of an object is restricted to the methods of its class."

It is important because that's how you communicate with objects. It's the
interface, which is public, instead of the implementation, which is private.

But if you understood OO as well as you claim you would understand that.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '06 #58
Tony Marston wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:Cb******** *************** *******@comcast .com...
Tony Marston wrote:
And the opinion of other experts in the field - such as the ones I
mentioned before.
Even experts disagree on what is or is not the *right* way in OO, so all
I am doing is agreeing with those experts who disagree with your your
favourite experts.

But NONE of the experts disagree on message passing. Check out what
Booch, Rumbaugh or Iverson have to say, for instance. Especially Booch -
the founder of OO techniques.

Message passing exists in non-OO languages, so it not something whch is
unique to OO.


I never said it was unique to OO. Variables exist in non-OO languages also.
The difference is that message passing is an inherent requirement in OO
languages, where it isn't in non-OO languages. You can, for instance, write a
complete program in C without a function call other than main(). Or in VB with
no subroutines, etc.

It's not possible in an OO program.
Your implementation violates some of the basic reasons for even having
OO! And no, I don't believe MY way is the only way. But I believe the
experts in the field know a hell of a lot more about it than you do.
I disagree. I am using the three basic principles of OO, as documented,
to achieve a higher level of reuse than I could by using non-OO
techniques .

And you're missing the fourth principle.

Message passing is not unique to OO, and is not one of the fundamental
principles. It is simply the way that one object communicates with another.


And without it objects cannot communicate, so you have no program.
I suspect you've had no real-world OO experience. Large, complex
projects OO is designed to make easier. All of your experience is
probably simple PHP pages you do yourself with no collaboration.
At least I have not been taught by people who don't know what they're
talking about.

So obviously you have no real world experience.

Your attitude would never survive in a the large scale projects I've been
involved in (100+ programmers, 2 years+ time). But then it wouldn't
survive the smaller projects I've been involved in, either - (i.e. three
programme rs for two months).
The size of project is irrelevant. The OOP principles are the same
regardless of the size of project. The only project I have ever been
associated with which failed disastrously was one where the system
architects got carried away with their fancy ideas of how OOP should be
implemente d and produced something that was so inefficient and
unproducti ve that the client cancelled the entire project as soon as the
first live programs were produced. It was THEIR attitude that was wrong,
not mine.


If you had worked on something other than a 50 LOC web site you'd know
that is complete horse shit.

Excuse me? I have produced administrative web applications with over 500
components, so that puts me way beyond the 50 LOC web site.


"Administra tive web applications"? ROFLMAO! Try a real program. > 1M LOC,
100+ programmers working for over 2 years. Or even something with 10K LOC - all
in one file, not a bunch of separate web pages.

I'll bet none of your "web programs" has more than 500 LOC on a single page.
Just because some system architects didn't know what they were doing
doesn't mean OO is bad. It means only that they had no idea what they
were doing.

But they were folowing allthe rules, so how could they be wrong?


You don't read well, do you. Just because some system architects didn't know
what they were doing doesn't mean that OO is bad. It means only that they had
no idea what they were doing.
For the record - since starting with OO in 1988, I've been involved in a
number of projects - small to large. And every project where people knew
what they were doing was successful.

If your techniques produce something that works, then you are obviously
doing something right. It is only when the software does not work that you
can say that the techniques were wrong. My techniques work, therefore you
have no cause to say that the are wrong.


Wrong, wrong, wrong. And unfortunately the attitude of too many "programmer s"
like you who are "developing " web pages. You can get a lot of things to work.
That doesn't mean they are right. And you're "justificat ion" has too many holes
to count.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '06 #59
Tony Marston wrote:
"Jerry Stuckle" <js*******@attg lobal.net> wrote in message
news:Ir******** *************** *******@comcast .com...
Henk Verhoeven wrote:
Jerry Stuckle wrote:
> Actually, things like private declarations are very important.

IMHO private declarations are too rigid and therfore decrease
reusabilit y. I agree that it can be very usefull to know the intentions
of the developer of some code one is evaluating to call or some member
variable one is avaluating to access. But every now and then there are
good reasons to do it anyway, even if it was intended to be private. For
example lazy initialization and default reasoning both are often
implemente d using direct access to member variables. Another example is
using a visitor to implement persistency.

Now maybe you would say that i should change these member variables to
protected or public. There are two problems with this:
1. It may not be my own code. Then if i get an upgrade of this code,
these member variables will once again be private, unless i re-apply my
changes. This is uneccessary overhead.
2. By changing the private declaration the intension of the other
developer gets lost. Now i could put a comment in that it was intended to
be private, but in that case: why not put the @private marker in the
comment in the first place?

The fundamental point is: With these private and protected declarations
you get stuck with the uneccessarily limitations introduced by the
author. Object-orientation can lead to more reusability then conventional
parameterize d code exactly because the code can be overridden and
extended in ways the original author did not provide for. private and
protected declarations are a step backwards that is only reasonable if
you assume that future developers that will maintain or reuse your code
will ignore your intentions becuase they are fools. If this is the case,
i think you should tell your boss that you are limiting the reusability
of your code because you are aniticipating him to hire fools and let them
work on/with your code ;-)

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.


Henk,

Private declarations are key to OO programming.

No they are not. Encapsulation is not the same as data hiding. Please refer
to:
http://www.javaworld.com/javaworld/j...psulation.html
http://www.itmweb.com/essay550.htm


Give it up, Tony. You obviously can't even understand the information you
reference.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 27 '06 #60

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1670
by: Benjamin C. Pierce | last post by:
The Twelth International Workshop on Foundations of Object-Oriented Languges (FOOL 12) Saturday 15 January 2005 Long Beach, California, USA Following POPL 05 The search for sound principles for object-oriented languages has given rise to much work on the theory of programming languages during the past two decades, leading to a better understanding of the key
5
2932
by: Martin | last post by:
When was inheritance intruduced into object oriented programming? More generally, does anyone know or have any sources on when the different features were introduced into object oriented programming?
34
7135
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. Yensao
65
4309
by: Roger Smythe | last post by:
A means for the progressive decomposition a problem space into increasingly simpler component parts such that these component parts represent higher levels of conceptual abstraction, and are completely independent of each other except for their well-defined interfaces. This was an attempt to explain the gist of OOP to programmers accustomed to the structured programming paradigm. I tried to explain OOP in terms of ideals that can be...
14
2945
by: Rookie | last post by:
Is C an object oriented programming language?
100
5337
by: E. Robert Tisdale | last post by:
What is an object? Where did this term come from? Does it have any relation to the objects in "object oriented programming"?
8
1808
by: cppig1995 | last post by:
C++ is not only object-oriented language. I think the description of this group have to be changed. :-) Have fun! ---- cppig1995 (cppig1995@gmail.com) Daejeon Metropolitan City, Republic of Korea 11 years old in Western age.
47
5979
by: Thierry Chappuis | last post by:
Hi, I'm interested in techniques used to program in an object-oriented way using the C ANSI language. I'm studying the GObject library and Laurent Deniau's OOPC framework published on his web site at http://ldeniau.web.cern.ch/ldeniau/html/oopc/oopc.html. The approach is very instructive. I know that I could do much of this stuff with e.g. C++, but the intellectual challenge of implementing these concepts with pure ANSI C is relevant to...
46
3050
by: ajba74 | last post by:
Hi fellows, I am reading some books to learn the C programming language, and sometimes I have the feeling that when somebody becomes a C expert, he must learn a more modern and object-oriented language. When I read things like "... C++ is an evolution of C ..." or "... C is a subset of C++ ..." I tend to believe that I will have to learn C+ + sooner or later. It sounds like C++ is the future and C is the past (and will be no longer...
3
1551
by: notnorwegian | last post by:
i have some confusion over this. sure a class is basically a classification, like for example an animal or flower. and an object/instance of that class is then for example a cat. an object is an instance of a class. that i know, i also know how to program with classes etc. i am just confused about the term object-oriented.
0
9970
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10794
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10896
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9612
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5830
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6031
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4652
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.