View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sum2001 Midterm Review: OO Theory

1. Class - A blueprint of code that outlines what an object which instantiates from that class will do, be able to accomplish, and means to which it will perform tasks.
Instance - A creation of an object from a class. An object which behaves exactly as the class has said it will, with the ability to be mainipulated at the will of the user, restricted by the means of the language and operating environment.

2. A class method requires no instance of the class, known as an object, to be created. It can be called off the class at anytime. And this differs from the instance method which requires that an instance of the class be created, known again as an object. For every object created, there will be an instance of that method.

1. What else does a class describe?

2. What does it mean for a class method to be "called off a class"? What does it mean for an object to have an instance of a method?

3. Any takers? -Lex Spoon




1. A class can be thought of as a blueprint for an object. It lists the information that the object will hold, and what that object will be able to do with its, or other, information. Any object that is declared to be a type of a certain class will have all of the attributes and services that the class declares. A class also
specifies what properties an instance of it would inherit from
superclasses.
An instance of a class is an object; the object understands certain
messages, which are used to execute code contained within that
object's methods (which are the services it provides). It also has
attributes (er, individual data pieces) that it can manipulate and
whatnot.

2. A class method is one that can be executed without creating an
object that is an instance of the class. It does not have access to
instance data or instance methods without acess to a specific instance
of itself.
An instance method is one that can only be executed by an instantiated
object of a certain class. This instance method has access to the
data of the class that exists individually for each object that is an
instance of the class.

3. For each class variable, only one "instance" of it "exists,"; so,
any changes to this class variable are reflected in all instances of
this class (so.. it's.. umm.. static).
In contrast, all instances of a specific class have their own version
of each instance variable. So, if two objects, say A and B, are of
the same time, and each has instance variable x, then whatever A does
to x will not be reflected in B.


Great! 1. Attributes and Services only exist in class diagrams. What are they called when you get into programming? (In fact, it's not even a one-to-one match, though it's close.)

2. Good.

3. Great–a Smalltalk class variable is indeed just like a Java "static" variable. (and, if I'm not mistaken, like a C++ static variable). -Lex Spoon






Link to this Page