Sunday, March 31, 2019

Concepts of Object Oriented Techniques with OO Issues

Concepts of endeavor orient Techniques with OO Issues reverse endeavor- orientated frameworks offer re exercise at a high construct level promising several benefits to the emergence of complex clays. This paper seek to 1) define the concepts of intentive lens oriented techniques in addition with the OO issues, development techniques and concepts of bearing oriented computing machine programing, it is alike introduced the UML as an worka twenty-four hours and key tool for aspiration-oriented introduction, to boot 2) we look further into the frameworks from the perspective of aspiration-oriented techniques. In this section, it is aimed to define a rational promise betwixt intention oriented technology and frameworks. At the end, slightly future horizons for purpose oriented technology and frameworks atomic morsel 18 presended.I. Introduction reckoning power and ne bothrk bandwidth hire change magnitude dramatic bothy eachplace the olderen decade. However, the design and giveation of complex softw argon product remains expensive and demerit-pr unitary. untold of the equal and effort stems from the continuous re-discovery and re-invention of nerve center concepts and members across the softw atomic number 18 industry. In unique(predicate)(prenominal), the growing heterogeneity of hardw atomic number 18 architectures and smorgasbord of operating establishment and discourse platforms gulls it hard to build correct, portable, efficient, and inexpensive finishs from scratch. Object-oriented (OO) techniques and frameworks be promising technologies for reifying proven computer softw be designs and implementations in order to reduce the cost and improve the quality of softw atomic number 18. A framework is a reusable, semi-complete application that keep be specialized to sire custom applications 19. In contrast to to begin with OO re engross techniques establish on segmentation libraries, frameworks be targeted for parti cular melodic line units ( much(prenominal) as data treat or cellular communications1) and application domains ( much(prenominal) as habituater port wines or real- conviction avionics). Frameworks like MacApp, ET++, Interviews, ACE, Microsofts MFC and DCOM, JavaSofts RMI, and implementations of OMGs CORBA play an increasingly primary(prenominal) role in authoritative softw ar development.II. Object oriented concepts and techniques registerThe concept of ends and slips in work out had its first major breakthrough with the PDP-1 constitution at MIT which was probably the earlier fount of cap index found architecture. A nonher early practice was Sketchpad bring ond by Ivan Sutherland in 1963 however, this was an application and non a computer schedule paradigm. Objects as schedule entities were introduced in the 1960s in Simula 67, a programme language intentional for performing simulations, bring aboutd by Ole-Johan Dahl and Kristen Nygaard of the Norwegian C omputing Center in Oslo. (They were working on ship simulations, and were confounded by the combinatorial effusion of how the different attri scarcelyes from different ships could affect unrivalled an just about some otherwise. The idea occurred to them of grouping the different faces of ships into different var.es of intention lenss for each champion severalize of butts macrocosm responsible for defining its answer data and behavior.) Such an approach was a simple extrapolation of concepts earlier map in one(a)-dimensional programming. On analog computers, mapping from real-world phenomena/ aims to analog phenomena/ aims (and conversely), was (and is) called simulation. Simula not solely introduced the notion of folkes, but excessively of casefuls of classes, which is probably the first intelligible exercise of those notions. The ideas of Simula 67 influenced whatsoever(prenominal) an(prenominal) afterward languages, especially Small peach and der ivatives of enounce and Pascal.The Smalltalk language, which was demonstrable at Xerox PARC2 (by Alan Kay and others) in the 1970s, introduced the margin de end pointination-oriented programming to make for the pervasive use of targets and messages as the basis for computation. Smalltalk creators were influenced by the ideas introduced in Simula 67, but Smalltalk was designed to be a fully energising system in which classes could be created and modified dynamically rather than statically as in Simula 67. Smalltalk and with it OOP were introduced to a wider auditory sense by the August 1981 issue of Byte magazine.In the 1970s, Kays Smalltalk work had influenced the Lisp participation to incorporate physical intention- ground techniques which were introduced to developers via the Lisp machine. Experimentation with confused extensions to Lisp (like LOOPS and Flavors introducing eightfold inheritance and mixins), even sotually led to the Common Lisp Object System (CLOS , a part of the first standardized tendencyive lens-oriented programming language, ANSI Common Lisp), which integrates functional programming and fair game-oriented programming and countenances extension via a Meta-object protocol. In the 1980s, on that point were a few attempts to design processor architectures which included ironw be support for objects in remembering but these were not successful. Examples include the Intel iAPX 432 and the Linn last word Rekursiv.Object-oriented programming substantial as the dominant programming method actingology during the mid-1990s, by and large due to the influence of optical FoxPro 3.0 or possibly C++. Its command was further enhanced by the rising popularity of graphical user embrasures, for which object-oriented programming seems to be well-suited. An prototype of a closely link dynamic graphical user user port library and OOP language fundament be found in the hot chocolate frameworks on Mac OS X, written in Objective- C, an object-oriented, dynamic messaging extension to C institutiond on Smalltalk. OOP toolkits as well as enhanced the popularity of offspring-driven programming (although this concept is not moderate to OOP). Some feel that association with GUIs (real or perceived) was what propelled OOP into the programming mainstream.At ETH Zrich, Niklaus Wirth and his colleagues had as well been investigating such topics as data gazumpion and standard programming (although this had been in frequent use in the 1960s or earlier). Modula-2 (1978) included both(prenominal), and their succeeding design, Oberon, included a distinguishableive approach to object orientation, classes, and such. The approach is contradictory Smalltalk, and very unlike C++.Object-oriented features give away been added to m whatsoever existing languages during that time, including Ada, BASIC, Fortran, Pascal, and others. Adding these features to languages that were not initially designed for them lotstimes l ed to problems with compatibility and maintainability of economy. much recently, a number of languages have emerged that are primarily object-oriented yet harmonious with procedural methodology, such as Python and Ruby. probably the closely commercially historic recent object-oriented languages are Visual Basic.NET (VB.NET) and C, both designed for Microsofts .NET platform, and Java, developed by Sun Microsystems. VB.NET and C both support cross-language inheritance, renting classes outlined in bingle language to subclass classes delimit in the other language.Just as procedural programming led to refinements of techniques such as constructiond programming, modern object-oriented software design methods include refinements such as the use of design conventions, design by contract, and modeling languages (such as UML).The bourne OOPS, which look ups to an object-oriented programming system, was parkland in early development of object-oriented programming.III. unfathomed c oncepts and featuresClassDefines the abstract characteristics of a thing (object), including the things characteristics (its attributes, fields or right(a)ties) and the things behaviors (the things it squeeze out do, or methods, functions or features). One magnate say that a class is a formula or factory that describes the nature of something. For example, the class frank would consist of traits dual-lane by all dogs, such as breed and fur alter (characteristics), and the ability to bark and sit (behaviors). Classes go forth modularity and structure in an object-oriented computer program. A class should typically be recognizable to a non-programmer old(prenominal) with the problem domain, pisseding that the characteristics of the class should make sense in context. Also, the code for a class should be comparatively self- hold stard (generally development encapsulation). Collectively, the properties and methods defined by a class are called members.ObjectA pattern (exemp lar) of a class. The class Dog defines all possible dogs by spotisation the characteristics and behaviors they support have the object lass is adept particular dog, with particular versions of the characteristics. A Dog has fur young girl has brown-and-white fur.InstanceOne goat have an model of a class the pillowcase is the actual object created at runtime. In programmer jargon, the lass object is an eccentric of the Dog class. The sight of foster of the attributes of a particular object is called its call forth. The object consists of order and the behavior thats defined in the objects class. much on Classes, Metaclasses, Parameterized Classes, and ExemplarsThere are dickens ample categories of objects classes and instances. Users of object-oriented technology principlely specify of classes as containing the tuition necessary to create instances, i.e., the structure and capabilities of an instance is determined by its synonymic class. There are triad comm ho wever used (and different) views on the interpretation for classA class is a pattern, template, or blue sign for a family of structurally identical compass points. The items created development the class are called instances. This is a good deal associatered to as the class as a cookie cutter view. As you might guess, the instances are the cookies.A class is a thing that consists of both a pattern and a tool for creating items based on that pattern. This is the class as an instance factory view instances are the soul items that are manufactured (created) using the classs human race mechanism.A class is the send of all items created using a specific pattern. express some other focussing, the class is the commemorate of all instances of that pattern.We should bill that it is possible for an instance of a class to also be a class. A metaclass is a class whose instances themselves are classes. This means when we use the instance human beings mechanism in a metaclass, the instance created give itself be a class. The instance mental home mechanism of this class back end, in turn, be used to create instances although these instances may or may not themselves be classes.A concept very homogeneous to the metaclass is the parametric quantityized class. A parameterized class is a template for a class wherein specific items have been identified as being evolve ond to create non-parameterized classes based on the template. In effect, a parameterized class nookie be viewed as a fill in the blanks version of a class. One stinkpotnot like a shot use the instance mental hospital mechanism of a parameterized class. First, we must write out the required parameters, resulting in the creation of a non-parameterized class. at one time we have a non-parameterized class, we endure use its creation mechanisms to create instances.In this paper, we depart use the term class to mean metaclass, parameterized class, or a class that is n each a metaclass no r a parameterized class. We bequeath make a distinction sole(prenominal) when it is necessary to do so. Further, we get out occasionally refer to non-class instances. A non-class instance is an instance of a class, but is itself not a class. An instance of a metaclass, for example, would not be a non-class instance.In this paper, we leave sometimes refer to instantiation. Instantiation has two popular meaningsas a verb, instantiation is the process of creating an instance of a class, andas a noun, an instantiation is an instance of a class.Some raft flash back the use of the term object to instances of classes. For these people, classes are not objects. However, when these people are confronted with the concepts of metaclasses and parameterized classes, they have a obstacle attempting to resolve the problems these concepts introduce. For example, is a class that is an instance of a metaclass an object even though it is itself a class? In this paper, we will use the term obj ect to refer to both classes and their instances. We will only distinguish among the two when needed.Black Boxes and InterfacesObjects are unrelenting boxes. Specifically, the underlying implementations of objects are mystic from those that use the object. In object-oriented systems, it is only the manufacturer (creator, designer, or builder) of an object that knows the flesh out about the internal construction of that object. The consumers (users) of an object are denied intimacy of the home(a) workings of the object, and must deal with an object via unrivaled of its three distinct larboardsThe universal interface. This is the interface that is open (visible) to everybody.The inheritance interface. This is the interface that is accessible only by direct distinctions of the object. (We will controvert inheritance and specialization by and by in this chapter.) In class-based object-oriented systems, only classes nookie provide an inheritance interface.The parameter int erface. In the case of parameterized classes, the parameter interface defines the parameters that must be supplied to create an instance of the parameterized class. other way of locution that an item is in the everyday interface of an object is to say that the object exports that item. Similarly, when an object requires information from international of itself (e.g., as with the parameters in a parameterized class), we rump say that the object ineluctably to import that information. assemblyIt is, of course, possible for objects to be composed of other objects. Aggregation is eitherThe process of creating a unfermentedfound object from two or more other objects, orAn object that is composed of two or more other objects.For example, a go through object could be fashioned from a calendar month object, a day object, and a year object. A arguing of name calling object, for example, discount be thought of as containing m all an(prenominal) name objects.A massive object is a n object that has no externally-discernible structure. Said another way, a monolithic object does not appear to have been constructed from two or more other objects. Specifically, a monolithic object jackpot only be inured as a glutinous whole. Those outside of a monolithic object nookynot presently interact with any (real or imagined) objects within the monolithic object. A radio button in a graphical user interface (GUI) is an example of a monolithic object. conglomerate objects are objects that have an externally-discernible structure, and the structure can be turn to via the familiar interface of the intricate object. The objects that correspond a compound object are referred to as grammatical constituent objects. Composite objects meet one or both of the following criteriaThe rural area of a mixed plant object is now affected by the presence or absence of one or more of its office objects, and/orThe gene objects can be directly referenced via the unrestricted interface of their match composite object.It is useful to cleave composite objects into two subcategories heterogeneous composite objects and like composite objectsA heterogeneous composite object is a composite object that is conceptually composed of component objects that are not all conceptually the same. For example, a date (made up of a month object, a day object, and a year object) is a heterogeneous composite object.A homogeneous composite object is a composite object that is conceptually composed of component objects that are all conceptually the same. For example, a slant of take aimes is a homogeneous composite object.The rules for excogitation heterogeneous composite objects are different from the rules for designing homogeneous composite objects.differentiation and inheritanceAggregation is not the only way in which two objects can be related. One object can be a specialization of another object. Specialization is eitherThe process of defining a vernal object b ased on a (typically) more narrow rendering of an existing object, orAn object that is directly related to, and more narrowly defined than, another object.Specialization is usually associated with classes. It is usually only in the so-called classless object-oriented systems that we think of specialization for objects other than classes.Depending on their technical foul background, thither are a number of different ways in which people express specialization. For example, those who are familiar with an object-oriented programming language called Smalltalk refer to specializations as subclasses and to the jibe installations of these specializations as superclasses. Those with a background in the C++ programming language use the term derived class for specialization and base class for correspondent generalizations.It is viridity to say that everything that is admittedly for a generalization is also true for its corresponding specialization. We can, for example, define checking musical scores and savings flyers as specializations of pious platitude accounts. Another way of reflexion this is that a checking account is a kind of stateory financial institution account, and a savings account is a kind of situate account. Still another way of expressing this idea is to say that everything that was true for the argot account is also true for the savings account and the checking account.In an object-oriented context, we articulate of specializations as inheriting characteristics from their corresponding generalizations. Inheritance can be defined as the process whereby one object acquires (gets, receives) characteristics from one or more other objects. Some object-oriented systems digest only single inheritance, a stain in which a specialization may only acquire characteristics from a single generalization. Many object-oriented systems, however, allow for multiple inheritance, a situation in which a specialization may acquire characteristics from two or more corresponding generalizations.Our previous vernals of the coin aver account, checking account, and savings account was an example of single inheritance. A oscilloscope and a video recording sit are both specializations of device that enables one to see things far international. A television even off is also a kind of electronic device. You might say that a television peg down acquires characteristics from two different generalizations, device that enables one to see things far away and electronic device. Therefore, a television set is a product of multiple inheritance.Abstract ClassesWe usually think of classes as being complete definitions. However, there are situations where incomplete definitions are useful, and classes that represent these incomplete definitions are evenly useful. For example, in everyday conversation, we might talk about such items as bank accounts, insurance policies, and houses. In object-oriented thinking, we often isolate useful, but incompl ete, concepts such as these into their own special classes.Abstract classes are classes that embody tenacious and cohesive, but incomplete, concepts, and in turn, make these characteristics useable to their specializations via inheritance. People sometimes use the call partial type and abstract superclass as synonyms for abstract class. season we would never create instances of abstract classes, we most certainly would make their individua advert characteristics available to more specialized classes via inheritance.For example, come across the concept of an move. On one hand, most people know what an travel is. On the other hand, automobile is not a complete definition for any vehicle. It would be quite an accurate to describe automobile as the set of characteristics that make a thing an automobile, in other words, the nerve center of automobile-ness.OperationsThe public interface of an object typically contains three different categories of items procedures (sometimes refe rred to as method pickers, method interfaces, messages, or methods), regulars, and exclusions.An accomplishment in the public interface of an object advertises a functional capability of that object. For example, deposit would be an deed in the public interface of a bank account object, what is current temperature would be an deed in the public interface of a temperature sensor object, and step-up would be an surgical process in the public interface of a preclude object.The actual algorithm for accomplishing an exercise is referred to as a method. Unlike operations, methods are not in the public interface for an object. Rather, methods are hidden on the inside of an object. So, while users of bank account objects would know that they could make a deposit into a bank account, they would be unaware of the details as to how that deposit actually got credited to the bank account.We refer to the operations in the public interface of an object as suffered operations. Suffered oper ations are operations that meet two criteria they are things that relegate to an object, and they are in the public interface of that object. For example, we can say that a bank account suffers the operation of having a deposit made into it. The bank account can also suffer the operation of being queried as to its current balance. Some people also refer to suffered operations as exported operations.There are three broad categories of suffered operations, i.e.A selector is an operation that tells us something about the state of an object, but cannot, by definition, change the state of the object. An operation that tells us the current balance of a bank account is an example of a selector operation.A constructor is an operation that has the ability to change the state of an object. For example, an operation in the public interface to a mailbox object that added a message to the mailbox would be a constructor operation. (Please note that some people restrict the definition of the term constructor to those operations that cause instances of a class to come into existence.)In the context of a homogeneous composite object, an iterator is an operation that allows its users to escort (access) each of the component objects that make up the homogeneous composite object. If we have a inclination of an orbit of addresses, for example, and we wishing to scar the entire keep down, an iterator would allow us to visit each address object within the list and then, in turn, to print each address.Iterators can be further divided into two broad categories active (open) iterators and passive (closed) iterators. active iterators are objects in their own right. passive iterators are implemented as operations in the interface of the object over which they allow iteration. nonoperational iterators are further broken quite a little into selective iterators and constructive iterators. unresisting selective iterators do not allow their users to change the object over which the iteration takes place. Passive constructive iterators do allow users to change the object over which iteration takes place.We can also describe suffered operations as natural or composite. A uninitiate operation is an operation that cannot be accomplished simply, efficiently, and reliably without direct knowledge of the underlying (hidden) implementation of the object. As an example, we could argue that an operation that added an item to a list object, or an operation that deleted an item from a list object were primitive operations with valuate to the list object.Suppose that we wanted to create a swap operation, an operation that would swap in a new item in a list, while at the same time swapping out an old item in the same list. This is not a primitive operation since we can accomplish this with a simple conspiracy of the delete operation (deleting the old item) followed by the add operation (adding the new item). The swap operation is an example of a composite operation. A composite operation is any operation that is composed, or can be composed, of two or more primitive operations.Sometimes objects need help in maintaining their characteristics. Suppose, for example, that we wanted to create a generic wine tell list object. An ordered list is a list that must order its contents from the smallest to the largest. Specifically, every time we add an item to our ordered list, that item would have to be primed(p) in its proper position with respect to all the other items already in the list. By generic, we mean a template that can be instantiated with the household (class) of items we wish to place in the ordered list.It would not be unreasonable to implement this object as a parameterized class. Obviously, one of the parameters would be the category of items (e.g., class) that we desired to place in the list. For example, could instantiate (make an instance) the generic ordered list with a name class resulting in the creation of an ordered list of n ames class.There is a problem, however. Given that we could instantiate the generic ordered list with just about any category of items, how can we be indisputable that the ordered lists will know how to decent maintain order no matter what we use to instantiate the generic ordered list? Suppose, for example, that we wanted an ordered list of fazoomas. How could the generic list class tell if one fazooma was greater than or less than another fazooma?A solution would be for the generic ordered list to require a second parameter, a parameter over and above the category of items (class) that we desired to place in the list. This second parameter would be a The ConstantsIn addition to suffered operations, the public interface of an object can also contain invariables. Constants are objects of constant state. Imagine that we want to create a spring list of addresses class. A leap list is a list that has a fixed utmost number of elements. A bounded list can be empty, and it can con tain fewer than the maximum number of elements. It can even contain the maximum number of elements, but it can never contain more than the defined maximum number of elements. outwear that we place a constant in the public interface of our bounded list of addresses. This constant represents the maximum number of elements that can be placed in the bounded list. come in also that there is a suffered operation that will tell us how many elements (addresses, in our example) are shortly in the bounded list. We can now determine how much way is available in the bounded list by inquiring how many addresses are already in the list, and then subtracting this from the previously-defined constant.In some cases, as with the bounded list example above, constants are provided more for convenience than necessity. In other cases, such as in the case of encryption algorithms needing a seed cling to, constants are an implicit requirement.ExceptionsA third category of items that can be found in the public interface of objects is exceptions. Exceptions have two different definitionsan event that causes breakout of normal application execution, anda set of information directly relating to the event that caused suspension of normal application execution.Exceptions can be contrasted with an older, less reliable technology error codes. The idea bed error codes was fairly simple. You would postulation that an application, or part of an application, accomplish some work. One of the pieces of information that would be re dour to the requester would be an error code. If all had gone(p) well, the error code would typically have a value of zero. If any problems had occurred, the error code would have a non-zero value. It was also quite common to associate different non-zero values of an error code with specific errors. break codes suffered from two major problemsNo one was forced to actually check the value of returned error codes.Changes (additions, deletions, and modifications) in the meanings of the special values assigned to error codes were not self-movingally passed on to interested parties. Tracking the effects of a changed error code value often consumed a significant measure of resources.To bring in how exceptions directly address both of these issues, we first need to understand how exceptions typically workExceptions may be defined by the milieu or by the user.When an prodigious (but not unforeseen) condition occurs, an appropriate exception is activated. (People use different terms to express the energizing of an exception. The most common is raise. Less normally, people use the terms throw or activate.) This activation may be automatic (controlled by the environment) or may be expressly requested by the designer of the object or application.Examples of portentous conditions include trying to leave out something from an empty container, directing an elevator on the top floor to go up, and attempting to cause a date to take on an invalid value like February 31, 1993.Once the exception is activated, normal application execution lucre and control is transferred to a locally defined exception coach, if one is present. If no locally defined exception detentionr is present or if the exception handler is not equipped to handle the exception, the exception is propagated to the next high level of the application. Exceptions cannot be ignored. An exception will continue to be sent to higher levels of the application until it is either turned off or the application ceases to function.An exception handler checks to see what type of exception has been activated. If the exception is one that the handler recognizes, a specific set of actions is taken. Executing a set of actions in response to an exception is cognise as handling the exception. discussion an exception deactivates the exception the exception will not be propagated any further.Unlike error codes, exceptions cannot be ignored. Once an exception has been activated, it demands attention. In object-oriented systems, exceptions are placed in the public interfaces of objects. Changes in the public interfaces of objects very often require an automatic rechecking of all other objects that invoke operations in the changed objects. Thus, changes in exceptions result in at least a partially automated propagation of change information.Object Coupling and Object gumminessEngineers have known for centuries that the less any one part of a system knows about any other part of that same system, the break-dance the overall system. Systems whose components are highly commutative of each other are easier to fix and enhance than systems where there are strong interdependencies among some or all of the components. Highly independent system components are possible when there is minimal twin among the components, and each component is highly cohesive.Coupling is a measure of the strength of the connection between any two system components. The more any one compon ent knows about another component, the tighter (worse) the coupling is between those two components. Cohesion is a measure of how logically related the parts of an individual component are to each oConcepts of Object Oriented Techniques with OO IssuesConcepts of Object Oriented Techniques with OO IssuesAbstractObject-oriented frameworks offer reuse at a high design level promising several benefits to the development of complex systems. This paper sought to 1) define the concepts of object oriented techniques in addition with the OO issues, development techniques and concepts of object oriented programming, it is also introduced the UML as an ordinary and key tool for object-oriented design, additionally 2) we look further into the frameworks from the perspective of object-oriented techniques. In this section, it is aimed to define a reasonable promise between object oriented technology and frameworks. At the end, some future horizons for object oriented technology and frameworks are presented.I. IntroductionComputing power and network bandwidth have increased dramatically over the past decade. However, the design and implementation of complex software remains expensive and error-prone. Much of the cost and effort stems from the continuous re-discovery and re-invention of core concepts and components across the software industry. In particular, the growing heterogeneity of hardware architectures and diversity of operating system and communication platforms makes it hard to build correct, portable, efficient, and inexpensive applications from scratch. Object-oriented (OO) techniques and frameworks are promising technologies for reifying proven software designs and implementations in order to reduce the cost and improve the quality of software. A framework is a reusable, semi-complete application that can be specialized to produce custom applications 19. In contrast to earlier OO reuse techniques based on class libraries, frameworks are targeted for particular bu siness units (such as data processing or cellular communications1) and application domains (such as user interfaces or real-time avionics). Frameworks like MacApp, ET++, Interviews, ACE, Microsofts MFC and DCOM, JavaSofts RMI, and implementations of OMGs CORBA play an increasingly important role in contemporary software development.II. Object oriented concepts and techniquesHistoryThe concept of objects and instances in computing had its first major breakthrough with the PDP-1 system at MIT which was probably the earliest example of capability based architecture. Another early example was Sketchpad created by Ivan Sutherland in 1963 however, this was an application and not a programming paradigm. Objects as programming entities were introduced in the 1960s in Simula 67, a programming language designed for performing simulations, created by Ole-Johan Dahl and Kristen Nygaard of the Norwegian Computing Center in Oslo. (They were working on ship simulations, and were confounded by the combinatorial explosion of how the different attributes from different ships could affect one another. The idea occurred to them of grouping the different types of ships into different classes of objects each class of objects being responsible for defining its own data and behavior.) Such an approach was a simple extrapolation of concepts earlier used in analog programming. On analog computers, mapping from real-world phenomena/objects to analog phenomena/objects (and conversely), was (and is) called simulation. Simula not only introduced the notion of classes, but also of instances of classes, which is probably the first explicit use of those notions. The ideas of Simula 67 influenced many later languages, especially Smalltalk and derivatives of Lisp and Pascal.The Smalltalk language, which was developed at Xerox PARC2 (by Alan Kay and others) in the 1970s, introduced the term object-oriented programming to represent the pervasive use of objects and messages as the basis for comput ation. Smalltalk creators were influenced by the ideas introduced in Simula 67, but Smalltalk was designed to be a fully dynamic system in which classes could be created and modified dynamically rather than statically as in Simula 67. Smalltalk and with it OOP were introduced to a wider audience by the August 1981 issue of Byte magazine.In the 1970s, Kays Smalltalk work had influenced the Lisp community to incorporate object-based techniques which were introduced to developers via the Lisp machine. Experimentation with various extensions to Lisp (like LOOPS and Flavors introducing multiple inheritance and mixins), eventually led to the Common Lisp Object System (CLOS, a part of the first standardized object-oriented programming language, ANSI Common Lisp), which integrates functional programming and object-oriented programming and allows extension via a Meta-object protocol. In the 1980s, there were a few attempts to design processor architectures which included hardware support for objects in memory but these were not successful. Examples include the Intel iAPX 432 and the Linn Smart Rekursiv.Object-oriented programming developed as the dominant programming methodology during the mid-1990s, largely due to the influence of Visual FoxPro 3.0 or possibly C++. Its dominance was further enhanced by the rising popularity of graphical user interfaces, for which object-oriented programming seems to be well-suited. An example of a closely related dynamic GUI library and OOP language can be found in the Cocoa frameworks on Mac OS X, written in Objective-C, an object-oriented, dynamic messaging extension to C based on Smalltalk. OOP toolkits also enhanced the popularity of event-driven programming (although this concept is not limited to OOP). Some feel that association with GUIs (real or perceived) was what propelled OOP into the programming mainstream.At ETH Zrich, Niklaus Wirth and his colleagues had also been investigating such topics as data abstraction and modular programming (although this had been in common use in the 1960s or earlier). Modula-2 (1978) included both, and their succeeding design, Oberon, included a distinctive approach to object orientation, classes, and such. The approach is unlike Smalltalk, and very unlike C++.Object-oriented features have been added to many existing languages during that time, including Ada, BASIC, Fortran, Pascal, and others. Adding these features to languages that were not initially designed for them often led to problems with compatibility and maintainability of code.More recently, a number of languages have emerged that are primarily object-oriented yet compatible with procedural methodology, such as Python and Ruby. Probably the most commercially important recent object-oriented languages are Visual Basic.NET (VB.NET) and C, both designed for Microsofts .NET platform, and Java, developed by Sun Microsystems. VB.NET and C both support cross-language inheritance, allowing classes defined in one langu age to subclass classes defined in the other language.Just as procedural programming led to refinements of techniques such as structured programming, modern object-oriented software design methods include refinements such as the use of design patterns, design by contract, and modeling languages (such as UML).The term OOPS, which refers to an object-oriented programming system, was common in early development of object-oriented programming.III. Fundamental concepts and featuresClassDefines the abstract characteristics of a thing (object), including the things characteristics (its attributes, fields or properties) and the things behaviors (the things it can do, or methods, operations or features). One might say that a class is a blueprint or factory that describes the nature of something. For example, the class Dog would consist of traits shared by all dogs, such as breed and fur color (characteristics), and the ability to bark and sit (behaviors). Classes provide modularity and struc ture in an object-oriented computer program. A class should typically be recognizable to a non-programmer familiar with the problem domain, meaning that the characteristics of the class should make sense in context. Also, the code for a class should be relatively self-contained (generally using encapsulation). Collectively, the properties and methods defined by a class are called members.ObjectA pattern (exemplar) of a class. The class Dog defines all possible dogs by listing the characteristics and behaviors they can have the object Lassie is one particular dog, with particular versions of the characteristics. A Dog has fur Lassie has brown-and-white fur.InstanceOne can have an instance of a class the instance is the actual object created at runtime. In programmer jargon, the Lassie object is an instance of the Dog class. The set of values of the attributes of a particular object is called its state. The object consists of state and the behavior thats defined in the objects class.M ore on Classes, Metaclasses, Parameterized Classes, and ExemplarsThere are two broad categories of objects classes and instances. Users of object-oriented technology usually think of classes as containing the information necessary to create instances, i.e., the structure and capabilities of an instance is determined by its corresponding class. There are three commonly used (and different) views on the definition for classA class is a pattern, template, or blueprint for a category of structurally identical items. The items created using the class are called instances. This is often referred to as the class as a cookie cutter view. As you might guess, the instances are the cookies.A class is a thing that consists of both a pattern and a mechanism for creating items based on that pattern. This is the class as an instance factory view instances are the individual items that are manufactured (created) using the classs creation mechanism.A class is the set of all items created using a spe cific pattern. Said another way, the class is the set of all instances of that pattern.We should note that it is possible for an instance of a class to also be a class. A metaclass is a class whose instances themselves are classes. This means when we use the instance creation mechanism in a metaclass, the instance created will itself be a class. The instance creation mechanism of this class can, in turn, be used to create instances although these instances may or may not themselves be classes.A concept very similar to the metaclass is the parameterized class. A parameterized class is a template for a class wherein specific items have been identified as being required to create non-parameterized classes based on the template. In effect, a parameterized class can be viewed as a fill in the blanks version of a class. One cannot directly use the instance creation mechanism of a parameterized class. First, we must supply the required parameters, resulting in the creation of a non-parame terized class. Once we have a non-parameterized class, we can use its creation mechanisms to create instances.In this paper, we will use the term class to mean metaclass, parameterized class, or a class that is uncomplete a metaclass nor a parameterized class. We will make a distinction only when it is necessary to do so. Further, we will occasionally refer to non-class instances. A non-class instance is an instance of a class, but is itself not a class. An instance of a metaclass, for example, would not be a non-class instance.In this paper, we will sometimes refer to instantiation. Instantiation has two common meaningsas a verb, instantiation is the process of creating an instance of a class, andas a noun, an instantiation is an instance of a class.Some people restrict the use of the term object to instances of classes. For these people, classes are not objects. However, when these people are confronted with the concepts of metaclasses and parameterized classes, they have a diffi culty attempting to resolve the problems these concepts introduce. For example, is a class that is an instance of a metaclass an object even though it is itself a class? In this paper, we will use the term object to refer to both classes and their instances. We will only distinguish between the two when needed.Black Boxes and InterfacesObjects are black boxes. Specifically, the underlying implementations of objects are hidden from those that use the object. In object-oriented systems, it is only the producer (creator, designer, or builder) of an object that knows the details about the internal construction of that object. The consumers (users) of an object are denied knowledge of the inner workings of the object, and must deal with an object via one of its three distinct interfacesThe public interface. This is the interface that is open (visible) to everybody.The inheritance interface. This is the interface that is accessible only by direct specializations of the object. (We will d iscuss inheritance and specialization later in this chapter.) In class-based object-oriented systems, only classes can provide an inheritance interface.The parameter interface. In the case of parameterized classes, the parameter interface defines the parameters that must be supplied to create an instance of the parameterized class.Another way of saying that an item is in the public interface of an object is to say that the object exports that item. Similarly, when an object requires information from outside of itself (e.g., as with the parameters in a parameterized class), we can say that the object needs to import that information.AggregationIt is, of course, possible for objects to be composed of other objects. Aggregation is eitherThe process of creating a new object from two or more other objects, orAn object that is composed of two or more other objects.For example, a date object could be fashioned from a month object, a day object, and a year object. A list of names object, fo r example, can be thought of as containing many name objects.A monolithic object is an object that has no externally-discernible structure. Said another way, a monolithic object does not appear to have been constructed from two or more other objects. Specifically, a monolithic object can only be treated as a cohesive whole. Those outside of a monolithic object cannot directly interact with any (real or imagined) objects within the monolithic object. A radio button in a graphical user interface (GUI) is an example of a monolithic object.Composite objects are objects that have an externally-discernible structure, and the structure can be addressed via the public interface of the composite object. The objects that comprise a composite object are referred to as component objects. Composite objects meet one or both of the following criteriaThe state of a composite object is directly affected by the presence or absence of one or more of its component objects, and/orThe component objects c an be directly referenced via the public interface of their corresponding composite object.It is useful to divide composite objects into two subcategories heterogeneous composite objects and homogeneous composite objectsA heterogeneous composite object is a composite object that is conceptually composed of component objects that are not all conceptually the same. For example, a date (made up of a month object, a day object, and a year object) is a heterogeneous composite object.A homogeneous composite object is a composite object that is conceptually composed of component objects that are all conceptually the same. For example, a list of addresses is a homogeneous composite object.The rules for designing heterogeneous composite objects are different from the rules for designing homogeneous composite objects.Specialization and InheritanceAggregation is not the only way in which two objects can be related. One object can be a specialization of another object. Specialization is eitherT he process of defining a new object based on a (typically) more narrow definition of an existing object, orAn object that is directly related to, and more narrowly defined than, another object.Specialization is usually associated with classes. It is usually only in the so-called classless object-oriented systems that we think of specialization for objects other than classes.Depending on their technical background, there are a number of different ways in which people express specialization. For example, those who are familiar with an object-oriented programming language called Smalltalk refer to specializations as subclasses and to the corresponding generalizations of these specializations as superclasses. Those with a background in the C++ programming language use the term derived class for specialization and base class for corresponding generalizations.It is common to say that everything that is true for a generalization is also true for its corresponding specialization. We can, fo r example, define checking accounts and savings accounts as specializations of bank accounts. Another way of saying this is that a checking account is a kind of bank account, and a savings account is a kind of bank account. Still another way of expressing this idea is to say that everything that was true for the bank account is also true for the savings account and the checking account.In an object-oriented context, we speak of specializations as inheriting characteristics from their corresponding generalizations. Inheritance can be defined as the process whereby one object acquires (gets, receives) characteristics from one or more other objects. Some object-oriented systems permit only single inheritance, a situation in which a specialization may only acquire characteristics from a single generalization. Many object-oriented systems, however, allow for multiple inheritance, a situation in which a specialization may acquire characteristics from two or more corresponding generalizati ons.Our previous discussion of the bank account, checking account, and savings account was an example of single inheritance. A telescope and a television set are both specializations of device that enables one to see things far away. A television set is also a kind of electronic device. You might say that a television set acquires characteristics from two different generalizations, device that enables one to see things far away and electronic device. Therefore, a television set is a product of multiple inheritance.Abstract ClassesWe usually think of classes as being complete definitions. However, there are situations where incomplete definitions are useful, and classes that represent these incomplete definitions are equally useful. For example, in everyday conversation, we might talk about such items as bank accounts, insurance policies, and houses. In object-oriented thinking, we often isolate useful, but incomplete, concepts such as these into their own special classes.Abstract cl asses are classes that embody coherent and cohesive, but incomplete, concepts, and in turn, make these characteristics available to their specializations via inheritance. People sometimes use the terms partial type and abstract superclass as synonyms for abstract class. While we would never create instances of abstract classes, we most certainly would make their individual characteristics available to more specialized classes via inheritance.For example, consider the concept of an automobile. On one hand, most people know what an automobile is. On the other hand, automobile is not a complete definition for any vehicle. It would be quite accurate to describe automobile as the set of characteristics that make a thing an automobile, in other words, the essence of automobile-ness.OperationsThe public interface of an object typically contains three different categories of itemsoperations (sometimes referred to as method selectors, method interfaces, messages, or methods),constants, andex ceptions.An operation in the public interface of an object advertises a functional capability of that object. For example, deposit would be an operation in the public interface of a bank account object, what is current temperature would be an operation in the public interface of a temperature sensor object, and increment would be an operation in the public interface of a counter object.The actual algorithm for accomplishing an operation is referred to as a method. Unlike operations, methods are not in the public interface for an object. Rather, methods are hidden on the inside of an object. So, while users of bank account objects would know that they could make a deposit into a bank account, they would be unaware of the details as to how that deposit actually got credited to the bank account.We refer to the operations in the public interface of an object as suffered operations. Suffered operations are operations that meet two criteria they are things that happen to an object, and th ey are in the public interface of that object. For example, we can say that a bank account suffers the operation of having a deposit made into it. The bank account can also suffer the operation of being queried as to its current balance. Some people also refer to suffered operations as exported operations.There are three broad categories of suffered operations, i.e.A selector is an operation that tells us something about the state of an object, but cannot, by definition, change the state of the object. An operation that tells us the current balance of a bank account is an example of a selector operation.A constructor is an operation that has the ability to change the state of an object. For example, an operation in the public interface to a mailbox object that added a message to the mailbox would be a constructor operation. (Please note that some people restrict the definition of the term constructor to those operations that cause instances of a class to come into existence.)In the context of a homogeneous composite object, an iterator is an operation that allows its users to visit (access) each of the component objects that make up the homogeneous composite object. If we have a list of addresses, for example, and we wish to print the entire list, an iterator would allow us to visit each address object within the list and then, in turn, to print each address.Iterators can be further divided into two broad categories active (open) iterators and passive (closed) iterators. Active iterators are objects in their own right. Passive iterators are implemented as operations in the interface of the object over which they allow iteration. Passive iterators are further broken down into selective iterators and constructive iterators. Passive selective iterators do not allow their users to change the object over which the iteration takes place. Passive constructive iterators do allow users to change the object over which iteration takes place.We can also describe suffered operations as primitive or composite. A primitive operation is an operation that cannot be accomplished simply, efficiently, and reliably without direct knowledge of the underlying (hidden) implementation of the object. As an example, we could argue that an operation that added an item to a list object, or an operation that deleted an item from a list object were primitive operations with respect to the list object.Suppose that we wanted to create a swap operation, an operation that would swap in a new item in a list, while at the same time swapping out an old item in the same list. This is not a primitive operation since we can accomplish this with a simple combination of the delete operation (deleting the old item) followed by the add operation (adding the new item). The swap operation is an example of a composite operation. A composite operation is any operation that is composed, or can be composed, of two or more primitive operations.Sometimes objects need help in maintaining th eir characteristics. Suppose, for example, that we wanted to create a generic ordered list object. An ordered list is a list that must order its contents from the smallest to the largest. Specifically, every time we add an item to our ordered list, that item would have to be placed in its proper position with respect to all the other items already in the list. By generic, we mean a template that can be instantiated with the category (class) of items we wish to place in the ordered list.It would not be unreasonable to implement this object as a parameterized class. Obviously, one of the parameters would be the category of items (e.g., class) that we desired to place in the list. For example, could instantiate (make an instance) the generic ordered list with a name class resulting in the creation of an ordered list of names class.There is a problem, however. Given that we could instantiate the generic ordered list with just about any category of items, how can we be sure that the orde red lists will know how to properly maintain order no matter what we use to instantiate the generic ordered list? Suppose, for example, that we wanted an ordered list of fazoomas. How could the generic list class tell if one fazooma was greater than or less than another fazooma?A solution would be for the generic ordered list to require a second parameter, a parameter over and above the category of items (class) that we desired to place in the list. This second parameter would be a The ConstantsIn addition to suffered operations, the public interface of an object can also contain constants. Constants are objects of constant state. Imagine that we want to create a bounded list of addresses class. A bounded list is a list that has a fixed maximum number of elements. A bounded list can be empty, and it can contain fewer than the maximum number of elements. It can even contain the maximum number of elements, but it can never contain more than the defined maximum number of elements.Assu me that we place a constant in the public interface of our bounded list of addresses. This constant represents the maximum number of elements that can be placed in the bounded list. Assume also that there is a suffered operation that will tell us how many elements (addresses, in our example) are currently in the bounded list. We can now determine how much room is available in the bounded list by inquiring how many addresses are already in the list, and then subtracting this from the previously-defined constant.In some cases, as with the bounded list example above, constants are provided more for convenience than necessity. In other cases, such as in the case of encryption algorithms needing a seed value, constants are an absolute requirement.ExceptionsA third category of items that can be found in the public interface of objects is exceptions. Exceptions have two different definitionsan event that causes suspension of normal application execution, anda set of information directly re lating to the event that caused suspension of normal application execution.Exceptions can be contrasted with an older, less reliable technology error codes. The idea behind error codes was fairly simple. You would request that an application, or part of an application, accomplish some work. One of the pieces of information that would be returned to the requester would be an error code. If all had gone well, the error code would typically have a value of zero. If any problems had occurred, the error code would have a non-zero value. It was also quite common to associate different non-zero values of an error code with specific errors.Error codes suffered from two major problemsNo one was forced to actually check the value of returned error codes.Changes (additions, deletions, and modifications) in the meanings of the special values assigned to error codes were not automatically passed on to interested parties. Tracking the effects of a changed error code value often consumed a signifi cant amount of resources.To understand how exceptions directly address both of these issues, we first need to understand how exceptions typically workExceptions may be defined by the environment or by the user.When an exceptional (but not unforeseen) condition occurs, an appropriate exception is activated. (People use different terms to express the activation of an exception. The most common is raise. Less commonly, people use the terms throw or activate.) This activation may be automatic (controlled by the environment) or may be expressly requested by the designer of the object or application.Examples of exceptional conditions include trying to remove something from an empty container, directing an elevator on the top floor to go up, and attempting to cause a date to take on an invalid value like February 31, 1993.Once the exception is activated, normal application execution stops and control is transferred to a locally defined exception handler, if one is present. If no locally de fined exception handler is present or if the exception handler is not equipped to handle the exception, the exception is propagated to the next higher level of the application. Exceptions cannot be ignored. An exception will continue to be sent to higher levels of the application until it is either turned off or the application ceases to function.An exception handler checks to see what type of exception has been activated. If the exception is one that the handler recognizes, a specific set of actions is taken. Executing a set of actions in response to an exception is known as handling the exception. Handling an exception deactivates the exception the exception will not be propagated any further.Unlike error codes, exceptions cannot be ignored. Once an exception has been activated, it demands attention. In object-oriented systems, exceptions are placed in the public interfaces of objects. Changes in the public interfaces of objects very often require an automatic rechecking of all ot her objects that invoke operations in the changed objects. Thus, changes in exceptions result in at least a partially automated propagation of change information.Object Coupling and Object CohesionEngineers have known for centuries that the less any one part of a system knows about any other part of that same system, the better the overall system. Systems whose components are highly independent of each other are easier to fix and enhance than systems where there are strong interdependencies among some or all of the components. Highly independent system components are possible when there is minimal coupling among the components, and each component is highly cohesive.Coupling is a measure of the strength of the connection between any two system components. The more any one component knows about another component, the tighter (worse) the coupling is between those two components. Cohesion is a measure of how logically related the parts of an individual component are to each o

No comments:

Post a Comment