What is object-orientated software. (Software Intelligence: Teach-In).Object-oriented software is about objects. An object is a "black box" which receives and sends messages. A black box contains code (sequences of computer instructions) and data (information on which the instructions operate).Traditionally, in programming practice, code and data have been kept apart. For example, in the C language, units of code are called functions, while units of data are called structures. Functions and structures are not formally connected in C..A C function can operate on more than one type of structure, and more than one function can operate on the same structure. However, in o-o (object-oriented) programming, code and data are merged into one indivisible INDIVISIBLE. That which cannot be separated. 2. It is important to ascertain when a consideration or a contract, is or is not indivisible. When a consideration is entire and indivisible, and it is against law, the contract is void in toto. 11 Verm. 592; 2 W. thing -- an object. This has some big advantages. Software Design Consultants developed a 'black box' metaphor for an object. The primary rule of which is that the user of an object should never need to look inside the box since all communication to it is done via messages The object which a message is sent to is called the receiver of the message. Messages define the interface to the object. Everything an object can do is represented by its message interface, the user shouldn't have to know anything about what is in the black box in order to use it. Not looking inside the object's black box doesn't tempt tempt v. tempt·ed, tempt·ing, tempts v.tr. 1. To try to get (someone) to do wrong, especially by a promise of reward. 2. you to directly modify that object. If you did, you would be tampering tampering The adulteration of a thing. See Drug tampering. with the details of how the object works. Suppose the person who programmed the object in the first place decided later on to change some of these details? Then you would be in trouble. Your software would no longer work correctly! But so long as you just deal with objects as black boxes via their messages, the software is guaranteed to work. Providing access to an object only through its messages, while keeping the details private is called information hiding Keeping details of a software routine (function or object) private. Programmers only know what input is required and what outputs are expected. See encapsulation and abstraction. . An equivalent buzzword A term that refers to the latest technology or a term that sounds catchy. If not a flash in the pan, new technologies become mainstream. For example, Java was a hot buzzword in the 1990s, but should remain a major topic for decades. is encapsulation (1) In object technology, the creation of self-contained modules that contain both the data and the processing. See object-oriented programming. (2) The transmission of one network protocol within another. . Why all this concern for being able to change software? Because experience has taught us that software changes. A popular adage is that "software is not written, it is re-written". And some of the costliest mistakes in computer history have come from software that breaks when someone tries to change it. Classes How are objects defined? An object is defined via its class, which determines everything about an object Objects are individual instances of a class. For example, you may create an object call Spot from class Dog. The Dog class defines what it is to be a Dog object, and all the "dog-related" messages a Dog object can act upon. All object- oriented languages have some means, usually called a factory, to "manufacture" object instances from a class definition. You can make more than one object of this class, and call them Spot, Fido, Rover, etc. The Dog class defines messages that the Dog objects understand, such as "bark", "fetch", and "roll-over". You may also hear the term method used. A method is simply the action that a message carries out. It is the code, which gets executed when the message is sent to a particular object. Arguments are often supplied as part of a message. For example, the "fetch" message might contain an argument that says what to fetch, like "the-stick". Or the "roll-over" message could contain one argument to say how fast, and a second argument to say how many times. Examples: If you wanted to add two numbers, say, 1 and 2, in an ordinary, non-object-oriented computer language like C you might write this: a = 1; b = 2; c = a + b; This says, "Take a, which has the value 1, and b, which has the value 2, and add them together using the C language's built-in addition capability. Take the result, 3, and place it into the variable called c." Here's the same thing expressed in Smalltalk, which is a pure object-oriented language object-oriented language - object-oriented programming : a := 1. b := 2. c := a + b. Except for some minor notational differences, this looks exactly the same! It is the same, but the meaning is dramatically different. In Smalltalk, this says, "Take the object a, which has the value 1, and send it the message "+ ", which included the argument b, which, in turn, has the value 2. Object a, receive this message and perform the action requested, which is to add the value of the argument to yourself. Create a new object, give this the result, 3, and assign this object to c." This seems like a far more complicated way of accomplishing exactly the same thing! So why bother? The reason is that objects greatly simplify matters when the data get more complex. Suppose you wanted a data type called list, which is a list of names. In C, list would he defined as a structure.
struct list {
<definition of list structure data here>
};
list a, b, c;
a = "John Jones";
b= "Suzy Smith";
Try to add these new a and b in the C language: c = a + b; This doesn't work. The C compiler Noun 1. C compiler - a compiler for programs written in C compiling program, compiler - (computer science) a program that decodes instructions written in a higher order language and produces an assembly language program will generate an error when it tries to compile this because it doesn't know what to do with a and b. C compilers just know how to add numbers. But a and b are not numbers. One can do the same thing in Smalltalk but this time list is made a class, which is a subclass In programming, to add custom processing to an existing function or subroutine by hooking into the routine at a predefined point and adding additional lines of code. subclass - derived class of the built-in Smalltalk class called "String": a : = List fromString: 'John Jones' b : = List fromstring: 'Suzy Smith' c : = a + b. The first two lines simply create List objects a and b from the given strings. This now works, because the list class was created with a method which specifically "knows" how to handle the message "+". For example, it might simply combine the argument with its own object by sticking them together with a comma separating them (this is done with a single line of Smalltalk). So c will have the new value: 'John Jones,'Suzy Smith' Here's another example of a "+" message using more interesting objects. Click a, b, and c in turn to find out what they are (you'll need a WWW browser (hypertext, World-Wide Web) WWW browser - A browser for use on the World-Wide Web. with support for "aiff" sounds): c = a+b Using Non-Object-Oriented Languages It's also possible to use objects and messages in plain old non-object-oriented languages. This is done via function calls, which look ordinary, but which have object-oriented machinery behind them. Among other things, this allows sophisticated client-server software to run "transparently" from within ordinary programming languages. Suppose you added a "plus" function to a C program: int plus (int arg1, int arg2) {return (arg1 + arg2) ; ) } This hasn't really bought you anything yet. But suppose that instead of doing the addition on your own computer, you automatically sent it to a server computer to be performed: int plus (int arg1, int arg2) ( return server_plus (argl, arg2) ; } The function server_plus( )in turn creates a message containing arg1 and arg2, and sends this message, via a network, to a special object which sits on a server computer. This object executes the "plus" function and sends the result back to you. It's object-oriented computing via a back-door approach! This example is not very fancy, and, it's easier to simply add two numbers directly. There is, however, no limit to the complexity of an object. A single object can include entire databases, with millions of pieces of information. In fact, such database objects are common in client-server software. This also illustrates the flexibility of the object-oriented approach. In the usage just described, the object is very different from the earlier "a + b" example. Here, it receives two arguments, namely, the two objects that it is supposed to add. Previously, in the Smalltalk example, the object that was receiving a message was the first object, a But in a client-server environment, the addition is not done locally, on the client machine, but remotely, on a server machine. The server machine contains the object that the message is sent to, and since it doesn't know anything about the first argument, you have to send both arguments. Inheritance If there is already a class which can respond to a bunch of different messages, what if you wanted to make a new, similar class which adds just a couple of more messages? Why have to re-write the entire class? Of course, in any good object-oriented language, you don't. All you need to do is create a subclass (or derived class (programming) derived class - (Or "subclass") In object-oriented programming, a class that is derived from a base class by inheritance. The derived class contains all the features of the base class, but may have new features added or redefine existing features. , in C++ terminology) of the original class. This new class inherits all the existing messages, and therefore, all the behavior of the original class. The original class is called the parent class, or superclass In object technology, a high-level class that passes attributes and methods (data and processing) down the hierarchy to subclasses, the classes below it. Abstract superclasses are used as master structures and no objects are created for it. Concrete superclasses are used to create objects. , of the new class. Some more jargon -- a subclass is said to be a specialization of its superclass, and the conversely a superclass a generalization of its subclasses. Inheritance also promotes reuse. You don't have to start from scratch to start (again) from the very beginning; also, to start without resources. - Thackeray. See also: Scratch when you write a new program. You can reuse an existing repertoire of classes that have behaviors similar to what you need in the new program. For example, after creating the class Dog, you might make a subclass called Wolf, which defines some wolf-specific messages, such as hunt. Or it might make more sense to define a common class called Canis, of which both Dog and Wolf are subclasses. Much of the art of o-o programming is determining the best way to divide a program into an economical set of classes. In addition to speeding development time, proper class construction and reuse results in far fewer lines of code The statements and instructions that a programmer writes when creating a program. One line of this "source code" may generate one machine instruction or several depending on the programming language. A line of code in assembly language is typically turned into one machine instruction. , which translates to less bugs and lower maintenance costs. Object-Oriented Languages There are almost two dozen major object-oriented programming languages object-oriented programming language - object-oriented programming in use today. But the leading commercial o-o languages are far fewer in number. These are: * C++ * Smalltalk * Java C++ C++ is an object-oriented version of C. It is compatible with C (it is actually a superset A group of commands or functions that exceed the capabilities of the original specification. Software or hardware components designed for the original specification will also operate with the superset product. However, components designed for the superset will not work with the original. ), so that existing C code can be incorporated into C++ programs. C++ programs are fast and efficient, qualities which helped make C an extremely popular programming language. It sacrifices some flexibility in order to remain efficient however. C++ uses compile-time binding, which means that the programmer must specify the specific class of an object, or at the very least, the most general class that an object can belong to. This makes for high run-time efficiency and small code size, but it trades off some of the power to reuse classes. C++ has become so popular that most new C compilers are actually C/C C/C Center to Center C/C Combustion Chamber C/C Command/Control C/C Crew Chief C/C cabin cruiser (US DoD) C/C chief complaint (medical) C/C Channel-to-Channel C/C Communication and Collaboration ++ compilers. However, to take full advantage of object-oriented programming object-oriented programming, a modular approach to computer program (software) design. Each module, or object, combines data and procedures (sequences of instructions) that act on the data; in traditional, or procedural, programming the data are separated from the , one must program (and think!) in C++, not C. This can often he a major problem for experienced C programmers. Many programmers think they are coding in C++, but instead are only using a small part of the language's object-oriented power. Smalltalk Smalltalk is a pure object-oriented language. While C++ makes some practical compromises to ensure fast execution and small code size, Smalltalk makes none. It uses run-time binding, which means that nothing about the type of an object need be known before a Smalltalk program is run. Smalltalk programs are considered by most to be significantly faster to develop than C++ programs. A rich class library that can be easily reused via inheritance is one reason for this. Another reason is Smalltalk's dynamic development environment. It is not explicitly compiled, like C++. This makes the development process more fluid, so that "what if" scenarios can be easily tried out, and classes definitions easily refined. But being purely object- oriented, programmers cannot simply put their toes in the o-o waters, as with C++. For this reason, Smalltalk generally takes longer to master than C++. But most of this time is actually spent learning object-oriented methodology and techniques, rather than details of a particular pr ogramming language. In fact, Smalltalk is syntactically very simple, much more so than either C or C++. Unlike C++, which has become standardized, The Smalltalk language differs somewhat from one implementation to another. The most popular commercial "dialects" of Smalltalk are: * VisualWorks from ParcPlace-Digitalk, Inc. * Smalltalk/V and Visual Smalltalk An earlier application development environment for Smalltalk for Windows and OS/2 from the now-defunct ObjectShare, Inc., Sunnyvale, CA. It evolved out of the first commercial release of Smalltalk, known as Methods from Digitalk in 1983 (Digitalk and ParcPlace merged in 1995). from ParePlace-Digitalk Inc. * VisualAge from IBM (International Business Machines Corporation, Armonk, NY, www.ibm.com) The world's largest computer company. IBM's product lines include the S/390 mainframes (zSeries), AS/400 midrange business systems (iSeries), RS/6000 workstations and servers (pSeries), Intel-based servers (xSeries) VisualWorks VisualWorks is arguably ar·gu·a·ble adj. 1. Open to argument: an arguable question, still unresolved. 2. That can be argued plausibly; defensible in argument: three arguable points of law. the most powerful of Smalltalks. VisualWork's was developed by ParcPlace, which grew out of the original Xerox PARC A common reference to Xerox's famous PARC research and development center before it became a separate subsidiary of Xerox in 2002. See PARC. XEROX PARC - /zee'roks park'/ Xerox Corporation's Palo Alto Research Center. project that invented the Smalltalk language. VisualWorks is platform-independent, so that an application written under one operating system operating system (OS) Software that controls the operation of a computer, directs the input and output of data, keeps track of files, and controls the processing of computer programs. , say, Microsoft Windows See Windows. (operating system) Microsoft Windows - Microsoft's proprietary window system and user interface software released in 1985 to run on top of MS-DOS. Widely criticised for being too slow (hence "Windoze", "Microsloth Windows") on the machines available then. , can work without any modification on any of a wide range of platform supported by ParcPlace, from Sun Solaris to Macintosh. VisualWorks also features a GUI (Graphical User Interface) A graphics-based user interface that incorporates movable windows, icons and a mouse. The ability to resize application windows and change style and size of fonts are the significant advantages of a GUI vs. a character-based interface. (Graphic User Interface See GUI. ) builder that is well-integrated into the product. Smalltalk/V and Visual Smalltalk Digitalk's versions of Smalltalk are somewhat smaller and simpler, and are specifically tailored to IBM compatible (computer) IBM compatible - A computer which can use hardware and software designed for the IBM PC (or, less often, IBM mainframes). This was once a key phrase in marketing a new PC clone but now in 1998 is rarely used, the non-IBM wintel personal computer manufacturers such PCs. A Macintosh version was available, but support has since been abandoned. This does not bode bode 1 v. bod·ed, bod·ing, bodes v.tr. 1. To be an omen of: heavy seas that boded trouble for small craft. 2. well for Digitalk cross-platform efforts. Digitalk has a separate GUI builder Visual programming software that lets a user build a graphical user interface by dragging and dropping elements from a toolbar onto the screen. It may be a stand-alone program or part of an application development system or client/server development system. , called PARTS Workbench (bundled with Visual Smalltalk), which allows quick construct of an application. VisualAge IBMs version of Smalltalk, VisualAge, is comparable to Smalltalk/V with PARTS. Both of these Smalltalks allow programmers to readily exploit machine-specific features, at the expense of some portability. IBM has adapted existing industry standards for such things as file management and screen graphics. When IBM talks, people listen, and IBM has made a substantial commitment to Smalltalk. Java Java took the software world by storm due to its close ties with the Internet and Web browsers The following is a list of web browsers. Historical Historically important browsers In order of release:
Java is a curious mixture of C++ and Smalltalk. It has the syntax of C++, making it easy (or difficult) to learn, depending on your experience. But it has improved on C++ in some important areas. For one thing, it has no pointers, low-level programming constructs that make for error-prone programs. Like Smalltalk, it has garbage collection A software routine that searches memory for areas of inactive data and instructions in order to reclaim that space for the general memory pool (the heap). Operating systems may or may not provide this feature. , a feature that frees the programmer from explicitly allocating and de-allocating memory. It runs on a Smalltalk-style virtual machine, sofware built into a web browser which executes the same standard compiled Java bytecodes Java bytecode is the form of instructions that the Java virtual machine executes. Each bytecode instruction is one byte in length (hence the name), thus the number of bytecodes is limited to 256. Not all 256 possible bytecode values are used. no matter what type of computer being used. Java development tools are being rapidly deployed, and are available from such major software companies as IBM, Microsoft, and Symantec. www WWW or W3: see World Wide Web. (World Wide Web) The common host name for a Web server. The "www-dot" prefix on Web addresses is widely used to provide a recognizable way of identifying a Web site. .softwaredesign.com |
|
||||||||||||||||

Printer friendly
Cite/link
Email
Feedback
Reader Opinion