CompuServe Messages

#Oberon-2

    14-Sep-95 08:11:27
Sb: #48110-#Oberon-2
Fm: Jim Butterfield 73624,14
To: Peter Wade 100265,2740
>>Do you find OO [Object Oriented) to be a good method for designing programs? I don't make great use of it myself, but sometimes – in the middle of a data file reorganization – I wish I had done. Here's a rough sense of what OO gives you. You can (and should) take a piece of the program's operation, and make it a fully independent module. Let me explain that a bit further. For example, in laying out a data file system, you could take both the data structures and the programs that handle the data (find it, fetch it, change it, add new records, delete unwanted records), and bundle it all together as a "sealed" unit. Any application program that uses the data would then never go directly to it; instead, it would request the bundle to perform the desired action. The application program wouldn't know how the data was stored, or how it was fetched, just how to call the operations it needs. Here's the payoff: if it's ever desirable to change the setup of that data file, the whole job will take place within that sealed bundle. You might change the order or size of records, the sort/index method, whatever. The new bundle would just get folded into the application programs, which wouldn't notice that anything had changed, since they never touched that data directly. The same could be done with various I/O modules too, for example. –Jim