Application Object-Oriented Frameworksfacilitate communication between local and remote objects. ORB...

7
Object-oriented application frameworks are a promising technology 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 [7, 10]. In contrast to earlier OO reuse techniques based on class libraries, frameworks are targeted for particular busi- ness units (such as data processing or cellular commu- nications) and application domains (such as user interfaces or real-time avionics) [11]. Frameworks like MacApp, ET++, Interviews, ACE, Microsoft’s MFC and DCOM, JavaSoft’s RMI, and implementations of OMG’s CORBA play an increasingly important role in contemporary software development. The primary benefits of OO application frame- works stem from the modularity, reusability, extensi- bility, and inversion of control they provide to developers. Frameworks enhance modularity by encapsulating volatile implementation details behind stable inter- faces. Framework modularity helps improve software quality by localizing the impact of design and imple- mentation changes, which reduces the effort required Mohamed E. Fayad and Douglas C. Schmidt, Guest Editors VICTOR SADOWSKI Object-Oriented Application Frameworks Computing power and network bandwidth have increased dramatically over the past decade, yet the design and implementation of complex software remain expensive and error-prone. Much of the cost and effort stems from the continuous rediscovery and reinvention 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 make it difficult to build correct, portable, efficient, and inexpensive applications from scratch. 32 October 1997/Vol. 40, No. 10 COMMUNICATIONS OF THE ACM

Transcript of Application Object-Oriented Frameworksfacilitate communication between local and remote objects. ORB...

Page 1: Application Object-Oriented Frameworksfacilitate communication between local and remote objects. ORB frameworks eliminate many tedious, error-prone, and non-portable aspects of creating

Object-oriented application frameworks are apromising technology for reifying proven softwaredesigns and implementations in order to reduce thecost and improve the quality of software. A frameworkis a reusable, “semi-complete’’ application that can bespecialized to produce custom applications [7, 10]. Incontrast to earlier OO reuse techniques based on classlibraries, frameworks are targeted for particular busi-ness units (such as data processing or cellular commu-nications) and application domains (such as userinterfaces or real-time avionics) [11]. Frameworks likeMacApp, ET++, Interviews, ACE, Microsoft’s MFCand DCOM, JavaSoft’s RMI, and implementations ofOMG’s CORBA play an increasingly important rolein contemporary software development.

The primary benefits of OO application frame-works stem from the modularity, reusability, extensi-bility, and inversion of control they provide todevelopers.

Frameworks enhance modularity by encapsulatingvolatile implementation details behind stable inter-faces. Framework modularity helps improve softwarequality by localizing the impact of design and imple-mentation changes, which reduces the effort required

Mohamed E. Fayad and Douglas C. Schmidt, Guest Editors

VIC

TOR

SA

DO

WSK

I

Object-Oriented

Application

FrameworksComputing power and network bandwidth have increased dramatically over

the past decade, yet the design and implementation of complex software remain

expensive and error-prone. Much of the cost and effort stems from the continuous

rediscovery and reinvention 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 make it difficult to

build correct, portable, efficient, and inexpensive applications from scratch.

32 October 1997/Vol. 40, No. 10 COMMUNICATIONS OF THE ACM

Page 2: Application Object-Oriented Frameworksfacilitate communication between local and remote objects. ORB frameworks eliminate many tedious, error-prone, and non-portable aspects of creating

COMMUNICATIONS OF THE ACM October 1997/Vol. 40, No. 10 33

Page 3: Application Object-Oriented Frameworksfacilitate communication between local and remote objects. ORB frameworks eliminate many tedious, error-prone, and non-portable aspects of creating

to understand and maintain existing software.The stable interfaces provided by frameworks

enhance reusability by defining generic componentsthat can be reapplied to create new applications.Framework reusability leverages the domain knowl-edge and prior effort of experienced developers inorder to avoid re-creating and revalidating commonsolutions to recurring application requirements andsoftware design challenges. Reuse of framework com-ponents can yield substantial improvements in pro-grammer productivity, as well as enhancing thequality, performance, reliabilityand interoperability of software.

A framework enhances exten-sibility by providing explicithook methods [8] that allowapplications to extend its stableinterfaces. Hook methods sys-tematically decouple the stableinterfaces and behaviors of anapplication domain from thevariations required by instantia-tions of an application in a par-ticular context. Frameworkextensibility is essential to ensuretimely customization of newapplication services and features.

The run-time architecture of aframework is characterized by aninversion of control. This archi-tecture enables canonical appli-cation processing steps to becustomized by event handlerobjects that are invoked via theframework’s reactive dispatchingmechanism. When events occur, the framework’s dis-patcher reacts by invoking hook methods on pre-reg-istered handler objects, which performapplication-specific processing on the events. Inver-sion of control allows the framework (rather thaneach application) to determine which set of applica-tion-specific methods to invoke in response to exter-nal events (such as window messages arriving fromend users or packets arriving on particular communi-cation ports).

Overview of Widely Used Frameworks

Developers in certain domains have success-fully applied OO application frameworksfor many years. Early object-oriented

frameworks (such as MacApp and Interviews) origi-nated in the domain of graphical user interfaces.The Microsoft Foundation Classes (MFC) is a con-temporary GUI framework that has become the de

facto industry standard for creating graphical appli-cations on PC platforms. Although MFC has limi-tations (such as lack of portability to non-PCplatforms), its widespread adoption demonstratesthe productivity benefits of reusing common frame-works to develop graphical business applications.

Application developers in more complex domains(such as telecommunications, distributed medicalimaging, and real-time avionics) have traditionallylacked standard “off-the-shelf” frameworks. As aresult, developers in these domains largely build, val-

idate, and maintain software sys-tems from scratch. In an era ofderegulation and global competi-tion, however, it has become pro-hibitively expensive and extremelytime-consuming to develop appli-cations entirely in-house.

Fortunately, the next generationof OO application frameworks aretargeting complex business andapplication domains. At the heartof this effort are Object RequestBroker (ORB) frameworks, whichfacilitate communication betweenlocal and remote objects. ORBframeworks eliminate manytedious, error-prone, and non-portable aspects of creating andmanaging distributed applicationsand reusable service components.This enables programmers todevelop and deploy complex appli-cations rapidly and robustly, ratherthan wrestling endlessly with low-

level infrastructure concerns.

Classifying Application Frameworks

Although the benefits and design principlesunderlying frameworks are largely indepen-dent of the domains to which they are

applied, we’ve found it useful to classify frameworksby their scope, as follows:

System infrastructure frameworks simplify the devel-opment of portable and efficient system infrastruc-ture such as operating system [2] and communicationframeworks [9], and frameworks for user interfacesand language processing tools. System infrastructureframeworks are primarily used internally within asoftware organization and are not sold to customersdirectly.

Middleware integration frameworks are commonlyused to integrate distributed applications and com-ponents. Middleware integration frameworks are

34 October 1997/Vol. 40, No. 10 COMMUNICATIONS OF THE ACM

The benefits

of object-oriented

application

frameworks stem

from the modularity,

reusability, extensibility,

and inversion of control

they provide to

developers.

Page 4: Application Object-Oriented Frameworksfacilitate communication between local and remote objects. ORB frameworks eliminate many tedious, error-prone, and non-portable aspects of creating

COMMUNICATIONS OF THE ACM October 1997/Vol. 40, No. 10 35

designed to enhance the ability of software develop-ers to modularize, reuse, and extend their softwareinfrastructure to work seamlessly in a distributedenvironment. Middleware integration frameworksrepresent a thriving market, and are rapidly becom-ing commodities. Common examples include ORBframeworks, message-oriented middleware, andtransactional databases.

Enterprise application frameworks address broadapplication domains (such as telecommunications,avionics, manufacturing, and financial engineering[1, 10, 11]) and are the cornerstone of enterprisebusiness activities [3]. Relative to system infrastruc-ture and middleware integration frameworks, enter-prise frameworks are expensive to develop and/orpurchase. However, enterprise frameworks can pro-vide a substantial return on investment since theysupport the development of end-user applicationsand products directly. In contrast, system infrastruc-ture and middleware integration frameworks focuslargely on internal software development concerns.Although these frameworks are essential to createhigh-quality software rapidly, they typically do notgenerate substantial revenue for large enterprises. Asa result, it is often more cost-effective to buy systeminfrastructure and middleware integration frame-works rather than build them in-house [3, 4, 11].

Regardless of their scope, frameworks can also beclassified by the techniques used to extend them,which range along a continuum from white-boxframeworks to black-box frameworks. White-boxframeworks rely heavily on OO language features likeinheritance and dynamic binding in order to achieveextensibility. Existing functionality is reused andextended by (1) inheriting from framework baseclasses and (2) overriding pre-defined hook methodsusing patterns like the Template Method [5]. Black-box frameworks support extensibility by defininginterfaces for components that can be plugged intothe framework via object composition. Existing func-tionality is reused by (1) defining components thatconform to a particular interface and (2) integratingthese components into the framework using patternslike Strategy [5] and Functor.

White-box frameworks require application devel-opers to have intimate knowledge of each frame-work’s internal structure. Although white-boxframeworks are widely used, they tend to producesystems that are tightly coupled to the specific detailsof the framework’s inheritance hierarchies. In con-trast, black-box frameworks are structured usingobject composition and delegation rather than inher-itance. As a result, black-box frameworks are gener-ally easier to use and extend than white-box

frameworks. However, black-box frameworks aremore difficult to develop since they require frame-work developers to define interfaces and hooks thatanticipate a wider range of potential use cases [6].

Strengths and Weaknesses of Application Frameworks

When used in conjunction with patterns,class libraries, and components, OOapplication frameworks can signifi-

cantly increase software quality and reduce develop-ment effort. However, a number of challenges mustbe addressed in order to employ frameworks effec-tively. Companies attempting to build or use large-scale reusable frameworks often fail unless theyrecognize and resolve challenges such as develop-ment effort, learning curve, integrability, maintain-ability, validation and defect removal, efficiency,and lack of standards [10].

• While developing complex software is difficultenough, developing high quality, extensible, andreusable frameworks for complex applicationdomains is even harder. The skills required toproduce frameworks successfully often remainlocked in the heads of expert developers. One ofthe goals of this special section is to demystifythe software process and design principles associ-ated with developing and using frameworks.

• Learning to use an OO application frameworkeffectively requires considerable investment ofeffort. For instance, it often takes 6–12 monthsto become highly productive with a GUI frame-work like MFC or MacApp, depending on theexperience of the developers. Typically, hands-onmentoring and training courses are required toteach application developers how to use such aframework effectively. Unless the effort requiredto learn a framework can be amortized over manyprojects, this investment may not be cost-effec-tive. Moreover, the suitability of a framework fora particular application may not be apparentuntil the learning curve has flattened.

• Application development will be increasinglybased on the integration of multiple frameworks(e.g., GUIs, communication systems, databases)together with class libraries, legacy systems, andexisting components. However, many earlier gen-eration frameworks were designed for internalextension rather than for integration with otherframeworks developed externally. Integrationproblems arise at several levels of abstraction,ranging from documentation issues [3, 4], to theconcurrency/distribution architecture, to the

Page 5: Application Object-Oriented Frameworksfacilitate communication between local and remote objects. ORB frameworks eliminate many tedious, error-prone, and non-portable aspects of creating

event dispatching model. For instance, whileinversion of control is an essential feature of aframework, integrating frameworks with eventloops that are not designed to interoperate withother frameworks is hard.

• Application requirements change frequently.Therefore, the requirements of frameworks oftenchange as well. As frameworks evolve, the appli-cations that use them must evolve with them.

• Framework maintenance activities include modi-fication and adaptation of the framework. Bothmodification and adaptation may occur on thefunctional level (i.e., certain framework function-ality does not fully meet developers’ require-ments), as well as on the non-functional level(which includes more qualitative aspects such asportability or reusability).

• Framework maintenance may take differentforms, such as adding functionality, removingfunctionality, and generalization. A deep under-standing of the framework components and theirinterrelationships is essential to perform this tasksuccessfully. In some cases, the application devel-opers and/or the end-users must rely entirely onframework developers to maintain the frame-work.

• Although a well-designed modular framework canlocalize the impact of software defects, validatingand debugging applications built using frame-works can be tricky for the following reasons:

• Generic components are harder to validate in theabstract. A well-designed framework component

typically avoids application-specific details,which are provided via subclassing, object com-position, or template parameterization. Whilethis improves the flexibility and extensibility ofthe framework, it greatly complicates moduletesting since the components cannot be validatedin isolation from their specific instantiations. Itis usually hard to distinguish bugs in the frame-work from bugs in the application code. As withany software development, bugs are introducedinto a framework from many possible sources,such as failure to understand the requirements,overly coupled design, or an incorrect implemen-tation. When customizing the components in aframework to a particular application, the num-ber of possible error sources will increase.

• Inversion of control and lack of explicit controlflow. Applications written with frameworks canbe hard to debug since the framework’s“inverted’’ flow of control oscillates between theapplication-independent framework infrastruc-ture and the application-specific method call-backs. This increases the difficulty of“single-stepping’’ through the run-time behaviorof a framework within a debugger since the con-trol flow of the application is driven implicitlyby callbacks and developers may not understandor have access to the framework code. This issimilar to the problems encountered trying todebug a compiler lexical analyzer and parserwritten with LEX and YACC. In these applica-tions, debugging is straightforward when the

36 October 1997/Vol. 40, No. 10 COMMUNICATIONS OF THE ACM

Over the next several years, we expect the following frame-

work-related topics will receive considerable attention from

researchers and developers:

Reducing framework development effort. Traditionally,

reusable frameworks have been developed by generalizing from

existing systems and applications. Unfortunately, this incremental

process of organic development is often slow and unpredictable

since core framework design principles and patterns must be discov-

ered from the “bottom-up.’’ However, since many good framework

examples now exist, we expect that the next generation of develop-

ers will leverage this collective knowledge to conceive, design, and

implement higher-quality frameworks more rapidly [11].

Greater focus on domain-specific enterprise frame-

works. Existing frameworks have focused largely on system infra-

structure and middleware integration domains (such as user

interfaces [5, 8] and OS/communication systems [2, 6, 9, 11]). In

contrast, there are relatively few widely documented examples of

enterprise frameworks for key business domains such as manufac-

turing, banking, insurance, and medical systems [4, 11]. As more

experience is gained developing frameworks for these business

domains, however, we expect that the collective knowledge of

frameworks will be expanded to cover an increasingly wide range of

domain-specific topics and an increasing number of enterprise appli-

cation frameworks will be produced [3, 4]. As a result, benefits of

frameworks will become more immediate to application program-

mers as well as to infrastructure developers.

Black-box frameworks. Many framework experts [7, 10]

favor black-box frameworks over white-box frameworks since

black-box frameworks emphasize dynamic object relationships (via

patterns like Bridge and Strategy [5]) rather than static class rela-

tionships. Thus, it is easier to extend and reconfigure black-box

frameworks dynamically. As developers become more familiar with

techniques and patterns for factoring out common interfaces and

components, we expect that an increasing percentage of black-box

frameworks will be produced.

Framework documentation. Accurate and comprehensible

documentation is crucial to the success of large-scale frameworks.

Future Trends

Page 6: Application Object-Oriented Frameworksfacilitate communication between local and remote objects. ORB frameworks eliminate many tedious, error-prone, and non-portable aspects of creating

COMMUNICATIONS OF THE ACM October 1997/Vol. 40, No. 10 37

thread of control is in theuser-defined action routines.Once the thread of controlreturns to the generated DFAskeleton, however, it is hardto trace the program’s logic.

Frameworks enhance extensi-bility by employing additionallevels of indirection. For instance,dynamic binding is commonlyused to allow developers to sub-class and customize existinginterfaces. However, the resultinggenerality and flexibility oftenreduce efficiency. For instance, inlanguages like C++ and Java, theuse of dynamic binding makes itimpractical to support ConcreteData Types (CDTs), which areoften required for time-criticalsoftware. The lack of CDTs yields(1) an increase in storage layout(due to embedded pointers to vir-tual tables), (2) performance degradation (due to theadditional overhead of invoking a dynamically boundmethod and the inability to inline small methods),and (3) a lack of flexibility (due to the inability toplace objects in shared memory).

Currently, there are no widely accepted standardsfor designing, implementing, documenting, andadapting frameworks. Moreover, emerging industry

standard frameworks (such asCORBA, DCOM, and Java RMI)currently lack the semantics, fea-tures and interoperability to betruly effective across multipleapplication domains. Often, ven-dors use industry standards to sellproprietary software under theguise of open systems. Therefore, itis essential for companies and devel-opers to work with standards orga-nizations and middleware vendorsto ensure that the emerging specifi-cations support true interoperabil-ity and define features that meettheir software needs.

The Articles

The articles in this sectiondescribe how OO applica-tion frameworks provide a

powerful vehicle for reuse, as wellas a way to capture the essence ofsuccessful patterns, architectures,

components, policies, services, and programmingmechanisms. We begin with an overview of thetopic by Ralph Johnson. “Frameworks = (Compo-nents + Patterns)” compares and contrasts frame-works with other object-oriented reusetechniques—patterns and components.

“An Adaptive Framework for Developing Multi-media Software Components” by Posnak, Lavender,

However, documenting frameworks is a costly activity and contem-

porary tools often focus on low-level method-oriented documenta-

tion, which fails to capture the strategic roles and collaborations

among framework components. We expect that the advent of tools

for reverse-engineering the structure of classes and objects in com-

plex frameworks will help to improve the accuracy and utility of

framework documentation. Likewise, we expect to see an increase

in the current trend [4, 6, 9] of using design patterns to provide

higher-level descriptions of frameworks.

Processes for managing framework development. Frame-

works are inherently abstract since they generalize from a solution to

a particular application challenge to provide a family of solutions. This

level of abstraction makes it difficult to engineer their quality and man-

age their production. Therefore, it is essential to capture and articu-

late development processes that can ensure the successful

development and use of frameworks. We believe that extensive pro-

totyping and phased introduction of framework technology into orga-

nizations is crucial to reducing risk and helping to ensure successful

adoption [4, 10].

Framework economics. The economics of developing frame-

works include activities [4, 10] such as the following:

• Determining effective framework cost metrics, which measure the

savings of reusing framework components vs. building applications

from scratch;

• Cost estimation, which involves accurately forecasting the cost

of buying, building, or adapting a particular framework; and

• Investment analysis and justification, which determines the bene-

fits of applying frameworks in terms of return on investment.

We expect that the focus on framework economics will help to

bridge the gap among the technical, managerial, and financial aspects

of making, buying, or adapting frameworks [4].

Framework standards. In order to develop, document, inte-

grate, and adapt long-lived application frameworks, standards are a

must. As application frameworks become more complex and more

widely accepted, standards become invaluable and increasingly

essential. Standards assure consistency, and form a base to justify

the framework cost and protect the investment. We believe that

several standards will emerge, such as framework development,

framework adaptation, framework interoperability and integration

standards [10].

The articles

appearing here

reinforce our belief

that object-oriented

application

frameworks will be

at the core of

leading-edge software

technology in the

twenty-first century.

Page 7: Application Object-Oriented Frameworksfacilitate communication between local and remote objects. ORB frameworks eliminate many tedious, error-prone, and non-portable aspects of creating

38 October 1997/Vol. 40, No. 10 COMMUNICATIONS OF THE ACM

and Vin describes a framework that simplifies thedevelopment of dynamically adaptive multimediasoftware components by promoting the reuse of code,design patterns, and domain expertise. HansAlbrecht Schmid’s article “Systematic FrameworkDesign by Generalization” presents a systematicmethod for designing frameworks based on identify-ing “hot spots,” which capture key sources of varia-tion in an application domain.

“Framework Development for Large Systems’’ byBäumer et al. draws upon the authors’ experiencedeveloping large-scale industrial banking projects topresent concepts and techniques for domain parti-tioning, framework layering, and framework con-struction.

Demeyer, Meijler, Nierstrasz, and Steyaert alsofocus on hot spots in their article “Design Guidelinesfor ‘Tailorable’ Frameworks,” which presents designguidelines for developing frameworks for open sys-tems. “The Framework Life Span” by Brugali,Menga, and Aarsten highlights the relationshipsbetween application frameworks, patterns, and pat-tern languages in the domain of manufacturing sys-tems. “From Custom Applications to Domain-Specific Frameworks” by Codenie et al. discussessolutions to common framework development chal-lenges such as avoiding the proliferation of versions,estimating effort and alleviating the tendency towardarchitectural drift.

Adele Goldberg, Steven Abell, and David Leibsdescribe LearningWorks—a framework for exploringideas about computing and software system construc-tion—in a succinct contribution to this section.Another short article, “SEMATECH’s Experienceswith the CIM Framework,” by Doscher and Hodges,describes the structure of a framework for computer-integrated manufacturing of semiconductors.

We conclude the section with a brief considerationof lessons learned from our varied experiences apply-ing frameworks to real-world business situations.

The articles appearing here reinforce our beliefthat object-oriented application frameworks will beat the core of leading-edge software technology in thetwenty-first century. The extensive focus on applica-tion frameworks in the object-oriented communityoffers software developers an important vehicle forreuse and a means to capture the essence of successfulpatterns, architectures, components, and program-ming mechanisms.

It is significant that frameworks are becomingmainstream and that developers at all levels areincreasingly adopting and succeeding with frame-work technologies. However, OO application frame-works are ultimately only as good as the people who

build and use them. Creating robust, efficient, andreusable application frameworks requires develop-ment teams with a wide range of skills. We needexpert analysts and designers who have mastered pat-terns, software architectures, and protocols in order toalleviate the inherent and accidental complexities ofcomplex software. Likewise, we need expert middle-ware developers who can implement these patterns,architectures, and protocols within reusable frame-works. In addition, we need application programmerswho have the motivation, skills, and training to learnhow to use these frameworks effectively. We encour-age you to get involved with others working onframeworks by attending conferences, participatingin online mailing lists and newsgroups, and con-tributing your insights and experiences. More infor-mation can be found about this subject athttp://www.cs.unr.edu/~fayad/frameworks.

References

1. Birrer, E.T. Frameworks in the financial engineering domain: An expe-rience report. In Proceedings of ECOOP ‘93 Proceedings, Lecture Notes inComputer Science nr. 707, Springer-Verlag, 1993.

2. Campbell, R.H. and Islam, N. A technique for documenting theframework of an object-oriented system. Computing Systems 6, 4 (Fall1993).

3. Fayad, M.E. and Hamu, D.S. Object-oriented enterprise frameworks:Make vs. buy decisions and guidelines for selection. Commun. ACM,submitted for publication.

4. Fayad, M.E. and Hamu, D.S. Object-Oriented Enterprise Frameworks.Wiley, NY, 1997, to appear.

5. Gamma, E, Helm, R., Johnson, R. and Vlissides, J. Design Patterns:Elements of Reusable Software Architecture. Addison-Wesley, Reading,Mass., 1995.

6. Hueni, H., Johnson, R., and Engel, R. A framework for network pro-tocol software. In Proceedings of OOPSLA’95, (Austin, Texas, Oct.1995).

7. Johnson, R.E. and Foote, B. Designing reusable classes. J. Object-Ori-ented Programming 1, 5 (June/July 1988), 22–35.

8. Pree, W. Design Patterns for Object-Oriented Software Development. Addi-son-Wesley, Reading, Mass. 1994.

9. Schmidt, D.C. Applying design patterns and frameworks to developobject-oriented communication software. In P. Salus, Ed., Handbook ofProgramming Languages, Volume I, MacMillan Computer Publishing,1997.

10. Fayad, M.E., Schmidt, D.C., and Johnson, R.E. Object-Oriented Applica-tion Frameworks: Problems and Perspectives. Wiley, NY, 1997, to appear.

11. Fayad, M.E., Schmidt, D.C., and Johnson, R.E. Object-Oriented Applica-tion Frameworks: Implementation and Experience. Wiley, NY, 1997, toappear.

Mohamed Fayad ([email protected]) is an associate professor inthe College of Engineering at the University of Nevada-Reno. Douglas C. Schmidt ([email protected]) is an assistantprofessor in the Department of Computer Science at WashingtonUniversity in St. Louis, Missouri.

Permission to make digital/hard copy of part or all of this work for personal or class-room use is granted without fee provided that copies are not made or distributed forprofit or commercial advantage; the copyright notice, the title of the publication, andits date appear; and notice is given that copying is by permission of ACM, Inc. To copyotherwise, to republish, to post on servers, or to redistribute to lists requires prior spe-cific permission and/or a fee.

© ACM 0002-0782/97/1000 $3.50

c