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

Michael Levy

Yo. My name's Michael, but i generally go by Mike.

I'm a third year CS major.

In my spare time i like to hang out with my roommates, go to parties, have fun, etc...
I like playing sports, especially soccer and basketball. As far as organizations go, i'm in marching band here at Tech. More specifically i'm on the drumline. I love drumming and have been doing it for the past 8 years.

Current classes:
Math 3770
CS 2200
CS 2340
HTS 1031
Percussion Ensemble
Marching Band

Uploaded Image: door.gif

Object-Oriented Programming

Programming Language Comparison
Author: Jason Voegele

The article I read states that the six things that most agree all object-oriented languages have are:

1) Encapsulation/Information Hiding
2) Inheritance
3) Polymorphism/Dynamic Binding
4) All pre-defined types are Objects
5) All operations performed by sending messages to Objects
6) All user-defined types are Objects

Eiffel, Smalltalk, Ruby, Java, C#, C++, Python, Perl, and Visual Basic are the languages that are compared with regard to the qualities of being object-oriented as described above. The following tables, taken from the article, shows how each language stands up to these criteria.

Eiffel Smalltalk Ruby Java C# C++ Python Perl Visual Basic
Encapsulation / Information Hiding Yes Yes Yes Yes Yes Yes No Yes? Yes?
Inheritance Yes Yes Yes Yes Yes Yes Yes Yes? No
Polymorphism / Dynamic Binding Yes Yes Yes Yes Yes Yes Yes Yes? Yes (through delegation)
All pre-defined types are Objects Yes Yes Yes No No No Yes No No
All operations are messages to Objects Yes Yes Yes No No No No No No
All user-defined types are Objects Yes Yes Yes Yes Yes No Yes No No

Two of the most interesting things to catch my eye of all these languages, in regards to how they can be used, is how they stack up in regards to static vs. dynamic typing and generic classes.

Voegele describes the differences between static and dynamic typing as dynamic typing tends to be more flexible, thereby increasing productivity; whereas static typing is safer, more reliable and increases efficiency. Now it is possible to make static typing just as flexible as dynamic, however it takes much more well-defined type system. Of the languages compared in the article, Smalltalk, Ruby, Python and Perl are dynamic and the rest are all static.

Another way to make static type languages more flexible is through the use of generic classes, more specifically, the language’s ability to parameterize a class with specific data types. Of the static languages compared, only Eiffel and C++ support generic classes.

This relates the most closely to Alex Groleau's discussion one posting most notably because his discussion is based on the same article as mine. However, he goes more into depth as far as what it means to be an object-oriented language. This is an important matter to take into consideration, even before the content in my discussion, since the content discussed here is irrelevant if the language cannot even be classified as object-oriented.

In my opinion, until a language is created, that is infinitely flexible as well as extremely reliable and safe, there is always going to be differing languages available. Each language is going to have its strengths and weaknesses and it's up to the programmer to decide which language best meets the requirements for whatever it is being used for.

Design Patterns

Creational, Structural, and Behavioral Patterns

Part 1

Design patterns are general solutions to a common problem when designing software. They are pieces of unfinished code that can be applied to multiple software design problems. Design patterns are grouped into many categories, of which three of them are structural, creational, and behavioral.

Creational design patterns deal with object creation and trying to make sure that objects are created in a way that is suitable to the situation. When creating objects, the basic method has the potential of resulting in design problems or unwanted complexity. Creational design patterns solve this problem by making object creation more flexible.

Structural design patterns provide an easy way to find a simple way to realize relationships between entities, thereby making the design itself easier.

Behavioral design patterns finds, recognizes, and identifies the common communication patterns between objects. The benefit of this is that these patterns make software more flexible in the communication between the objects.

Part 2

An example of one design pattern is an event listener. It is designed to distribute data to objects that want to receive the data. However, it doesn't keep a record of where this data should go, especially if the record should need to change over the course of the running program. All that is needed is a way to setup a registration method, and then keep a running tab of everything that is interested and then send the data, whenever it arrives to the interested objects. This makes perfect sense to me and I can see multiple ways of using this in my code. The most predominant being handling user events such as mouse clicks or key presses.

Discussion 3

Part 1

This biggest problem that I've faced while working with Squeak is actually learning the langauge itself. Since Squeak itself is pretty poorly documented, it was very difficult to decipher the code and learn how to apply it, with a few changes as needed, to where I wanted to use it. An example of this is during a time where I was just trying different things in the workspace, I was trying to learn how to do just some pretty simple graphics in a morphic project and then animate those graphics. I was successful in getting the graphics loaded; however, I couldn't for the life of me get the animation to work. To solving this, I used the internet, in particular Google University (, and found code snippets with good documentation that I could then apply to my animation. In the end it turned out that I wasn't calling the right parent, startStepping, and my step method itself needed a little tweaking.

Discussion 4

Simulating the Rubber Ducky!
Each year, some little towns have rubber ducky races. Each participant purchases a rubber duck that has a number on it, with the proceeds typically going to some charity. The ducks are placed in lanes at the head of a river. When the lanes are opened, the ducks are off! The river currents will sweep forward the ducks in some lanes faster than ducks in other lanes, of course. Obstacles, like rocks, in a current will bump ducks into other currents.

You, being an intense competitor and a master hacker, have decided to simulate your local town’s race in order to optimize your duck’s performance. Make the assumption that all currents are in a linear (i.e., they travel in a straight line from a given lane to the finish line) at a set speed, and that obstacles in a current bump ducks randomly to one of the neighboring currents.

In designing this program I would have a total of four classes. I would have an Animator class, a Duck class, a RiverCurrent class, and an Obstacle class. The basic layout of the design would be that Animator takes care of drawing the duck(s), river, and obstacle(s). When its getting ready to draw things, it querries Duck to find out the ducks position on the course. Once it gets back the duck's position, it then updates the drawing and redraws everything to there new position. Since only the duck would be moving, as I would set up the program so you could see the entire course, only the duck would need to its position changed. As hinted at earlier, Duck would be responsible for keeping track of where its at. When asked for its position, Duck would first check with Obstacle to see if in its next movement it was going to hit an obstacle. If so Duck would randomly generate a direction and then notify Animator as to the change in its position. If Duck was not going to hit an obstacle, it would then go to RiverCurrent to find out how fast it is moving on the given current. RiverCurrent then would be responsible for holding the different speeds of the different currents and returning those speeds to Duck when asked for them. Finally, Obstacle, when instantiated, would create a random number of obstacles with positions inside the track and then store those locations so they can be looked up whenever Duck needs to move.

Uploaded Image: WIHappyHour.jpg
Wisconsin Happy Hour

Discussion 5

Using CRC cards

You are sitting around your apartment one day and you decide that for kicks and giggles you want to start designing a pseudo Mega-Man/Mario side-scroller game. The object of this game is to navigae the character, we'll call him Dude, through a map, jumping over pits and spikes, and either dodge or shoot enemies.

Use CRC cards to show how you would design the game. Then describe your design.

A) Characters
- Dude
- Enemies
B) Landscape
- Background
- Tranversed Ground

CRC Cards

Position | Landscape, Enemies
Move | Landscape, Enemies
Jump | Landscpae, Enemies
Shoot | Landscape, Enemies
Health | Enemies

Position | Landscape, Enemies
Move | Landscape, Enemies
Shoot | Landscape, Enemies
Health | Dude

Move Background | Dude
Move Traversed | Dude
Ground |

The way I have my game setup is to try and make each entity self contained. For example, Dude knows where he's at and knows how to move, jump and shoot. In order to do these things, Dude needs to check with where the enemies are at and what the situation with the landscape is to see if he can has hit a wall, fallen into a pit, or if he has hit an enemy. He also knows what his health is so he knows whether or not hitting an enemy or spikes will kill him or just hurt him. The same thing applies to enemies. They know where they are at and how to move and shoot and what their health is. More or less, Enemies is a copy of Dude because it needs to do all the same things. Finally, Landscape is responsible for checking with Dude to find out if Dude is moving and the background needs to move and whether or not the ground that Dude travels on needs to move according to how Dude moves.

How do the characters die? Isn't that a responsibility?

Links to this Page