13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

282Chapter 12Analysis and Design: Seeking the ObjectsTo take our example, suppose we have the following list of CRC cardsafter such an open brainstorming sessi<strong>on</strong>:• Database• Capital Account• Current Account• CEO• Computer• CFO• Director• Keyboard• ManagerWhere do you go from here? Let’s articulate a general principle.The first principle. If we could teach a programmer <strong>on</strong>ly <strong>on</strong>e thing aboutsoftware design, it would be this idea: less is more. Or, to quote Antoine deSaint-Exupéry: “Perfecti<strong>on</strong> is achieved not when nothing can be added, butwhen nothing can be taken away.” Or, to put it yet another way, always usethe KISS 3 principle. The best object design is the smallest possible number ofclasses that model the real objects and meet all the requirements.You are seeking simplifying abstracti<strong>on</strong>s.First of all, all the objects that represent technologies or implementati<strong>on</strong>details should be removed. In our list, this would include “Database,” “Computer,”and “Keyboard.” While it is likely that all three will be involved in thefinal product, they are not objects in the problem space. There is no theoreticalreas<strong>on</strong> why an OOA sessi<strong>on</strong> cannot produce a manual, n<strong>on</strong>computer soluti<strong>on</strong>.It is a comm<strong>on</strong> tendency to leap from problem analysis directly to technicalsoluti<strong>on</strong>s. “We can write that in Java,” “We can store those in Oracle,” “Thatcould be an XML file.” Statements like these are to be avoided at this stage.Those are details about the implementati<strong>on</strong>. You haven’t got a design toimplement yet!As we said, you are seeking simplifying abstracti<strong>on</strong>s. The next step, afterculling cards that do not represent real objects in the problem space, is togroup together the cards that have any attributes in comm<strong>on</strong>. If we look at our3. An acr<strong>on</strong>ym for: Keep It Simple, Stupid!

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!