Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
CoWeb Assignment 1
- Class Based Inheritance
- What is a class? In an object oriented system a class is a blueprint for how to build an instance of an object. It defines how to build new objects of the same kind.
- What is an instance? An object created from a particular class is an instance.
- How do the two relate? A class is the blueprint used to create each instance of an object.
- In Smalltalk, what is the difference between class variables and instance variables? Class variables allow common sharing of information across a range of subclasses while instance variables can only be assessed directly from the methods of their class and subclasses of that class.
- In Smalltalk, what is the difference between class and instance methods? Class methods are used to access information stored inside a class in Smalltalk while instance methods are used to modify an instance of an object.
- Message Passing
- What is message passing and how does it fit into the way you program in Smalltalk? All computation is triggered through message passing. You send a message to an object to make something happen. When you pass a message it triggers a method, in which the mapping of the message to the method is determined by the receiving object.
- How does message passing work together with the class-based inheritance? Because Smalltalk uses class-based inheritance, messages can be used to call methods that are defined for superclasses of a particular object.
- What are some of the advantages and disadvantages of message passing? The advantage of message passing is that all computation is performed in the same way. Whether you are creating a new object or doing a mathematical operation, Smalltalk handles it by passing a message which calls a method. One of the disadvantages is that when doing mathematical computations Smalltalk does not understand order of operations because it simply passes the messages as they are read from left to right. Operator-overloading is also a sideffect of this mechanism.
CoWeb Assignment 3
- History of Object Oriented Programming
- Kent Beck
- The creator of Extreme Programming
- Has written on software patterns and smalltalk
- Popularized CRC card with Ward Cunningham
- Created the JUnit unit testing framework along with Erich Gamma
- Alan Kay
- Known for his early work on Object Oriented programming and user interface design
- In the 1960s he worked on pioneering graphics applications including Sketchpad
- In the 1970s we worked for Xerox Corporation's Palo Alto Research Center developing networked workstations using Smalltalk. These were later commercialized as the Apple Macintosh
- Conceiver of the Dynabook concept which defined the basics of the laptop computer
- Considered by some as the architect of the modern windowing graphical user interface (GUI)
- Collaborated with many others to start the open source Squeak dynamic media software in December 1995 when he was still at Apple
- "The best way to predict the future is to invent it."
- Collection Classes
- How do OrderedCollection and Set differ? A Set is an unordered, unindexed collection of unique objects while and OrderedCollection is indexed by integers and ordered according to manner elements are added and removed.
- How do OrderedCollection and Array differ? Why would you use one over the other? The difference between an OrderedCollection and an Array is that an Array has a fixed size. It would be better to use an Array when you do no plan on adding or deleting elements from the collection.
- How do you use a Dictionary? Why is accessing a Dictionary so fast? Dictionarys are indexed using the unique key to obtain the corresponding value. Thus you have to search for values in a Dictionary by the key associated with it. Accessing a Dictionary is so fast because you do not have to search through the whole thing to find the value you are looking for. You automatically access the correct value based on the key associated with it.
- Why are frameworks useful? A framework is a reusable design for a software system or subsystem. This is expressed as a set of abstract classesand the way their instances collaborate for a specific type of software. Thus, a developer can use a framework as the foundation for a piece of software they need to create rather than have to write everything from scratch.
- What is the difference between a framework and a class library? There are three main differences between a framework and a class library. First, frameworks use inheritance more heavily. Second, they evolve more quickly than class libraries do. Finally, frameworks are often modified on the spot if they are not quite right.
- List two of the Squeak frameworks covered in this class and what they provide. One Squeak framework covered in this class is Sunit. Sunit allows programmers in Squeak to test their code by plugging test code; setUp, runTest, and tearDown into Sunit run method. The generic test code already exists, making it faster for the programmer to write test cases. A second framework covered in class is Morphic. It allows programmers to create new objects in Squeak that already have many useful features that would normally take extra time to create. Morphic adds a great deal of object control.
- Explain two of the reasons that a framework is difficult to develop. Because of the complexity of many frameworks they can be difficult to figure out. Often times it may take so long to learn how to use a certain framework that it would be just as quick or quicker to start from scratch and develop the functionality yourself. Another problem with many frameworks is the learning curve that may be involved. Because it is not something you have developed yourself, the framework may not be intuitive for you to use, making it difficult to take advantage of. With poor documentation, some frameworks may even be impossible to use.
Links to this Page