Objected oriented techniques,

Object oriented programming and design have become the latest fashion in software construction. Unfortunately these terms are often assumed to simply mean using a particular programming language, like C++ or Smalltalk. Here we look at some ideas underlying these terms.


Object oriented analysis and design are an attempt to change software into something where structure exists in a form which can be exploited to solve the problems of software construction. They seek to build software in a component based fashion, in the same way that mechanical and electrical engineers operate. They address the problems listed below directly by changing the way we think about and use software. In particular the term construction replaces writing as the key activity for software builders.

The description of a type of object is written as a class definition. Multiple copies of this can then be created in a program. Objects work together by activating operations in each other. These operations are often referred to as methods.

Object oriented programming is used in different contexts for quite different purposes. Smalltalk is a language designed for experimental programming and rapid prototyping. It offers very few safeguards against mistakes. Other object oriented languages, like C++, provide careful checking of your program and are more suited to building large systems.

By thinking in terms of objects as components we should be able to gain the following benefits:

productivity:

Systems can now be built from reusable components. Most software in a particular application area will already exist. Where it does not exist in quite the right form, it will be possible to modify its behaviour through inheritance without complete rewriting. True economies of scale now become possible. Also, a component based approach allows separate components to be built and tested individually, increasing economies of scale further.

reliability:

Since much software will be reused, not written anew, it should be more reliable. It becomes worthwhile to invest more resource in initial design of components and well used components will have been proved in use.

extensibility: Parallelism

The study of parallelism investigates the extent to which many processors can applied to some problem in order to shorten the time required to find a solution, or to enable the solutions to larger problems to be found in the same fixed timespan. The processors are said to be working "in parallel" or "concurrently".


"If one woman can have a baby in nine months, why can't nine women have a baby in one month?"

Or to put it more mundanely, what it is about certain computational tasks that makes it difficult or impossible to share the work out between p processors in an attempt to get the work done p times faster?

Consider the problem of adding together 8 numbers. With one processor, capable of adding two numbers in a single time step, we need 7 time steps. Make sure you see why.

Now suppose you have an unlimited number of such processors available. What is the smallest number of time steps in which the 8 numbers can be added, and how many processors are needed to achieve this effect?

The answer is that 4 processors can do the job in 3 time steps. In the first step, each processor adds together a different pair of numbers. In the second step, two processors each add a different pair of results from the first step. In the final step, one processor adds the two results from the second step. No matter how many processors we add, we can't add the numbers in fewer steps (unless we change our definition of what can be achieved by a single processor in a single step). We can't use 7 processors to add the numbers in one time step.

How about if you have n numbers? (You might find it easiest to restrict n to be a power of 2.)

Now try a similar exercise for the problem of deciding whether each of the 8 numbers is odd or even.

Some problems are more amenable to parallelised solution than others, sometimes by virtue of inherent dependencies between parts of the solution, sometimes because of restrictions imposed by the model of parallel computation within which we choose (or are forced) to work.

0 comments:

Bidvertiser

Designed by Posicionamiento Web | Bloggerized by GosuBlogger | Blue Business Blogger