Take the 2-minute tour ×

My question, is not a philosophical one, but one of methodology. I understand how we build software to mimic everyday processes and objects, like the 'car' object so well demonstrated. My question is about lesser concrete things. For example, If I were to build a search application that returns products and prices from a database (as a part of a much larger application), would I imagine this in terms of how it might be implemented in life? For example, a 'search agent' object in code that would mimic a real life 'human search agent' (create attributes and methods from that)? Essentially, if something doesn't have an obvious real-life counterpart, do we take that idea and create a representation of it so we CAN code it? How should I think about objects in an application that do not mimic life so much?

Thanks for all your input

share|improve this question
An object represents a collection of data and methods to act on that data. Nothing says it has to be concrete, although being logical and easy to follow will get you a long way. Real-world analogues don't exist for about 95% of what I code. –  Chris Jun 26 '12 at 0:00
Would you share in some capacity, an example of some code that wouldn't be analogous to the real-world? –  KiloJKilo Jun 26 '12 at 0:05
add comment

3 Answers

up vote 3 down vote accepted

Object Oriented design is not about mimicking real life objects.

That is just a lazy guidance on how to abstract objects for your problem domain. A good start but is not sufficient for more abstract problem domains.

The underlying idea is to be able to abstract those units that can be abstracted from other units within you problem domain based on data and behavior.

share|improve this answer
add comment

No, objects are conceptual units.

Real life objects are just used to INTRODUCE object oriented ideas, but objects don't have to correspond to "real" things, they also correspond to abstract concepts that have no real life equivalent.

share|improve this answer
add comment

Look at the functionality ,your inputs and outputs. Look for tasks to be done for example, Retrieving the data , processing the data and creating logical tables , representation of the data. You can break these tasks into smaller , yet similar tasks. For example the Connection to server tasks. The request sending tasks , parsing the request back. Try to break down your objective in smallest pieces and then you can put these small functions and data members into classes.

share|improve this answer
add comment

Your Answer


