Posts

Showing posts from August, 2009

Objects, Roles, Responsibilities, and Collaboration

Image
Buy at AllPosters.com My daughter loves to watch Christmas movies not only in Christmas season but the whole year long. I remember one movie she has watched a lot of times (because it is funny) is about a man chosen to be Santa Clause after the other Santa fell down from his roof. The movie was certainly very funny and we were laughing all the time when we watched it. When I am considering Object-Oriented (OO) programming, I am thinking about the movie and the role Santa Clause who plays in Christmas. Almost everybody loves Santa in Christmas because he delivers gifts, happiness, and hope to us. According to the movie, if one Santa falls, another one comes to play. I think this is really wonderful. In Object-Oriented programming, a program is a collection of interacting objects. A software application behaves and implements responsibilities. Objects in the application plays roles, performing corresponding responsibilities. For example, if we reinvent the North Pole machine

Why Algorithms?

Image
An algorithm is a finite sequence of instructions to solve a problem. And a program is computational method implementing algorithms to solve problems. Algorithm is one of essential factors to guarantee the success of a software system. Quite often there are multiple algorithms to solve a same problem. Certainly we would like to choose good algorithms to solve problems. How to measure if an algorithm is a good one? There are several factors such as effectiveness, correctness , efficiency, complexity, etc. Intuitively, a good algorithm should correctly and effectively solve a problem we have. It should be efficient, running fast and consuming memory space economically. It should be simple and natural. When evaluating algorithms, most time we focus on time and space efficiency of the algorithms. When a programmer is designing and implementing a program, the construction requires to pay attention to not only essentials but also details and to make decisions when there a

Thinking Object Oriented

Image
Object Oriented ( OO ) Programming is a programming paradigm that uses objects and interactions between them to design and implement software applications and computer programs. In the OO programming model, a program is a collection of interacting objects. Each object normally encapsulates data and operations that operate on the data. In contrast, in the conventional programming model, which is affected by the von N eumann computer architecture, a program is a list of subroutines or procedures or functions, which are composed of assignment statements, loops, and/or conditional if-else statements, etc. In this conventional procedural model, data and operations are separate. It is hard to structure code effectively to develop software applications when complexity reaches a certain level. Objects in OO programming are still machinelike, but they could be smart by careful design and implementation. Each object knows things, does things, and makes decisions. Each object pote