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 first 3 chapters (1-3).
1) The concepts and ideas associated with object-oriented programming originated in Norway in the 1960s. A programming language called Simula developed by Christian Nygaard and his associates at the University of Oslo is considered the first object-oriented language.
2) Smalltalk, perhaps more than any programming language before or after it, laid the foundation for object-oriented thinking and software construction.
3) A class in which one or more methods are not implemented is defined as an abstract class. A class in which all methods are implemented is a concrete class. Abstract classes are often defined near the top of a hierarchical structure of classes.Undefined or abstract methods are used in an abstract class to establish required behavior in any descendent concrete class. An instance of an abstract class cannot be created
4) Interface Java supports only single inheritance. That is, each class may have at most one parent.
A special type of abstract class, an interface, is available in Java. No fields (except static constants) are allowed in an interface and all methods must be abstract.
5) Delegation is a mechanism of problem solving in which one class designates another to take responsibility for a set of actions. Typically an object of the class that carries out the set of actions (the delegate) is held as a field in the class that delegates the responsibility.
6) Late binding is closely related to inheritance. Since methods may be redefined in descendent classes it is common for several specialized versions of a given method to exist in a class hierarchy, each with the same method signature (same function name, same return type, and same set of parameters). The runtime system is able to bind the correct version of a method to an object based on the specific type of the object.
7) An object is associated with a reference type –a class. It is more specifically an instance of a class.
8) Memory for an object and its contents (field values) is allocated dynamically using the object creation operator new.
9) Before an object can be created it must be declared to be of a reference type.
10) A class that implements the Cloneable interface may redefine the inherited clone method from Object. Its instances may then be sent the clone message.
11) The predefined equality operator returns true if the object references are identical. This is true only if there exist two separate references to the same underlying storage as when aliasing occurs.
12) Reference types include programmer-defined classes as well as the set of classes provided in the standard Java libraries.
13) The primitive types are not associated with a class and do not need to be created. They may be initialized at their point of declaration.
14) One of the most widely used Java classes is class String . This reference type is used to represent sequences of characters.
15) A StringBuffer object is not immutable, unlike a String object. A string buffer implements a mutable sequence of characters.
16) In Java, an array is an object and is represented by a reference type. Like all reference types an array must be created before it can be used.
17) A Vector can hold any number of elements, is dynamic, and is indexable; that is, one can insert or access information at a specific index. A Vector is dynamic and automatically resizes itself if an insertion causes the number of elements to exceed the current capacity.
18) An Enumeration allows one to traverse through all of the elements of a Vector.
19) Bertrand Meyer, perhaps more than any other writer, has clarified and influenced our thinking regarding the responsibilities between a class and its users. His ideas are contained in his seminal work Object-Oriented Software Construction , Second Edition (Prentice-Hall, 1997) and manifested in the Eiffel programming language and environment. His concept of design by contract has become a staple part of the thinking and practice in this field.Support for this concept has been embedded in many UML analysis and design tools. The Eiffel programming language is perhaps the only language that fully implements the ideas associated with this elegant and powerful set of ideas.
20) Object-oriented software development is centered on the construction of classes.
21) Classes represent a model of the application domain. Object-oriented software analysis and design are preoccupied with the discovery of classes and the relationships they have to each other.
22) Through composition –in which one class holds one or more objects from other classes –and inheritance, the architecture of a software system is defined. This architecture is ultimately realized at the implementation phase by the construction and definition of classes.
23) Design by contract involves a partnership between the producer and consumer of a class, and between the features promised in the class and the responsibility of using these features correctly. If both parties adhere to this contract, the resulting software has the potential to be more understandable and reliable.
24) A command is a feature that may change the internal state of a class instance. It is typically implemented as a method that does not return information –a function that returns void in Java.
25) A query is typically implemented as a method that returns information –a function that has a nonvoid return type in Java.
26) The totality of a class's commands and queries completely defines its behavior. In terms of design by contract, it is the commands and queries that specify both the producer side and user side of the agreement.
27) Each command and query must state the requirements that must be met in order to assure the correct outcome of the method. In addition, the command or query must state the conditions that will be guaranteed if the user requirements are met. In short, if the user complies precisely with the requirements of the command or query, it in turn will assure the user that a particular result shall be achieved.
28) In order for a precondition to have any validity it must be testable by the user.
29) The features that define a class include commands, queries, and private methods.
30) Packages provide a mechanism for physically grouping logically related classes into a common subdirectory, a mechanism for resolving name clashes if two or more classes have the same name, and controlled accessibility to the features of a class.
31) In general, to execute the code in a class that is part of a package, go to the subdirectory that is one back from the package name or use the classpath variable to point the virtual machine to your package directory. From a command shell invoke the virtual machine using java packageName.className.
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