Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top