Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

14. UML > A Bit of Reusability

A Bit of Reusability

It seems that the average complexity and size of software grows year after year. Does OOP scale well in this situation or does it make things more complicated?

James: First of all, it is unclear how fast the size of systems is growing. You can’t just measure the number of bytes in a program. If you generate code, then it is the number of source lines that matter, not the number of generated lines or bytes or whatever. If you use higher-level procedures, then complexity depends on the number of calls, not the amount of code executed. As we work at higher levels, we get larger systems, but their inherent complexity may not be all that much greater.

Even if you don’t buy that (and I don’t buy it entirely—systems do seem to be getting more complex), OO systems are a good way to proceed. But you need to separate OO from a primary focus on reusability. I know that building reusable parts was put at the center of OO by the original Smalltalk developers, but I think that is a mistake. You can have OO structure without focusing obsessively on trying to build a library of reusable parts containing every class you use in an application. Reusability is good, but it’s not really the main goal in most systems. It’s really hard to build good reusable libraries—most programmers can’t do it very well and shouldn’t be encouraged to try. It’s a separate task from system building. In designing a system, use OO structure to build a clean application made of classes that are easy to modify if needed, without insisting that they be ....


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint