A part of English Study
Object-Oriented Design
IS-A and HAS-A relationships and encapsulation are just the tip of the iceberg when it comes to object-oriented design. Many books and graduate theses have been dedicated to this topic. The reason for the emphasis on proper design is simple: money.The cost to deliver a software application has been estimated to be as much as ten times more expensive for poorly designed programs. Having seen the ramifications of poor designs, I can assure you that this estimate is not far-fetched.
Even the best object-oriented designers make mistakes. It is difficult to visualize the relationships between hundreds, or even thousands, of classes. When mistakes are discovered during the implementation(code writing) phase of a project, the amount of code that has to be rewritten can sometimes cause programming teams to start over from scratch.
The software industry has evolved to aid the designer. Visual object modeling languages, like the Unified Modeling Language(UML), allow designers to design and easily modify classes without having to write code first, because object-oriented components are represented graphically. This allows the designer to create a map of the class relationships and helps them recognize errors before coding begins. Another innovation in object-oriented design is design patterns. Designers noticed that many object-oriented designs apply consistently from project to project, and that it was useful to apply the same designs because it reduced the potential to introduce new design errors. Object-oriented designers then started to share these designs with each other. Now, there are many catalogs of these design patterns both on the Internet and in book from.
Although passing the Java certification exam does not require you to understand object-oriented design this thoroughly, hopefully this background information will help you better appreciate why the test writers chose to include encapsulation, and IS-A, and HAS-A relationships on the exam.
GLOSSARY
encapsulation, dedicated, proper, estimate, ramification, phase, scratch, evolve, innovation, consistently, potential
本文探讨了面向对象设计中的核心概念,如IS-A与HAS-A关系及封装,并介绍了设计模式和统一建模语言(UML)等工具如何帮助设计师在编码前发现并修正设计错误。
590

被折叠的 条评论
为什么被折叠?



