When is an object oriented program truly object oriented?
Posted
by
Syed Aslam
on Programmers
See other posts from Programmers
or by Syed Aslam
Published on 2012-06-12T14:18:03Z
Indexed on
2012/06/12
16:48 UTC
Read the original article
Hit count: 337
object-oriented
Let me try to explain what I mean:
Say, I present a list of objects and I need to get back a selected object by a user. The following are the classes I can think of right now:
ListViewer
Item
App [Calling class]
In case of a GUI application, usually click on a particular item is selection of the item and in case of a command line, some input, say an integer representing that item. Let us go with command line application here.
A function lists all the items and waits for the choice of object, an integer. So here, I get the choice, is choice going to conceived as an object? And based on the choice, return back the object in the list.
Does writing this program like the way explained above make it truly object oriented? If yes, how? If not, why?
Or is the question itself wrong and I shouldn't be thinking along those lines?
© Programmers or respective owner