Today i started reading Fundamentals of OOP and Data Structures in Java By Richard Wiener and Lewis J. Pinson
Below are few quotations i found from this book from the next 4 chapters (4-7).
1) Inheritance, as the name implies, involves the transmittal of behavioral characteristics from parent class to child class.Through inheritance one can establish behavior in a base class that is available and directly usable in a hierarchy of descendent classes that extend the base class.
2) A child class may extend a parent class by introducing one or more fields or methods not found in the parent or by redefining one or more parent class methods.
3) Through inheritance a strong dependency and association is established between parent class and child class. Strong dependencies need to be carefully justified.
4) The composition relationship is a whole/part relationship. One class representing the whole defines fields that represent the parts.
5) A strong aggregation relationship implies that the class representing the whole owns and is responsible for creating each of its aggregate parts. The aggregate parts cannot be shared among other objects.
6) A weak aggregation or reference relationship implies that the class representing the whole shares its aggregate parts possibly with other objects. These aggregate part objects have a life and identity of their own.
7) A UML class diagram shows the relationships among the classes that define a system. The fields as well as methods of each class are depicted for each class.
8) Inheritance is shown on a UML diagram with a broad-headed arrow going from the subclass to its parent.
9) Strong aggregation is shown on a UML diagram with a diamond attached to the whole and a line connecting to the part class.
10) A reference relationship is shown on a UML diagram with a line connecting the whole to the part class.
11) Errors or exceptions in Java are always an instance of a class derived from Throwable.
Key points to remember about errors and exceptions include the following.
12) Errors and exceptions may occur because of hardware problems, software glitches, or misuse of a program and may cause a program to crash with dire effects.
13) Languages that support exception handling allow the software developer to catch and handle exceptions in a graceful way. Java provides a rich hierarchy of exception and error classes under class Throwable .
14) Exceptions in Java come in two flavors –checked and unchecked. Checked exceptions that can be thrown within a calling method require that the calling method either advertise (by passing responsibility up the calling chain) the exception using a throws clause in its method header or handle the exception using a try/catch clause. There is no need to advertise errors or unchecked exceptions. Unchecked exceptions may be optionally handled with a try/catch clause.Errors should not be handled since they represent serious irrecoverable conditions. The best you can do is display a custom message in the console window. The runtime system has a default handling mechanism for all exceptions and errors.
15) The optional finally part of a try/catch clause provides a way to clean up unfinished business as a result of an exception being thrown.
About the Authors
Richard Wiener is Associate Professor of Computer Science at the University of Colorado at Colorado Springs and Editor-in-Chief of The Journal of Object-Oriented Programming. He is the author or co-author of twenty-one textbooks and professional books. In 1983 Richard Wiener received the Outstanding Teacher of the Year Award from the University of Colorado at Colorado Springs. His areas of research include object-oriented software development,simulated annealing and genetic algorithms, time series, and applied statistics.
Lewis J. Pinson is President of CIC and Associate Professor of Computer Science at the University of Colorado at Colorado Springs. His areas of expertise include computer software development, object-oriented problem solving,genetic algorithms, and complexity studies. He develops and presents training courses and intensive short courses and workshops on object-oriented problem solving and object-oriented languages. Dr. Pinson has authored or co-authored eight books.
Friday, 3 October 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment