Calhoun: The NPS Institutional Archive Theses and Dissertations Thesis Collection 2000-03 COM and XPCOM as a solution to Bamboo's versioning problem Daglar, Mithat. Monterey, California. Naval Postgraduate School http://hdl.handle.net/10945/32949 ' ...... NAVAL POSTGRADUATE SCHOOL Monterey, California THESIS COM AND XPCOM AS A SOLUTION TO BAMBOO'S VERSIONING PROBLEM by Mithat Daglar March 2000 Thesis Advisor: Michael Zyda Co-advisor: Michael V. Capps Approved for public release; distribution is unlimited. _DTIC QUALITY DlSPEC'l'ED 4 Form Approved REPORT DOCUMENTATION PAGE OMB No. 0704-0188 Public reporting burden for this collection of information is estimated to average 1 hour per response, including the time for reviewing instruction, searching existing data sources, gathering and maintaining the data needed, and completing and reviewing the collection of information. Send comments regarding this burden estimate or any other aspect of this collection of information, including suggestions for reducing this burden, to Washington headquarters Services, Directorate for Information Operations and Reports, 1215 Jefferson Davis Highway, Suite 1204, Arlington, VA 22202-4302, and to the Office of Management and Budget, Paperwork Reduction Project (0704-0188) Washington DC 20503. 1. AGENCY USE ONLY (Leave blank) 2. REPORT DATE 3. REPORT TYPE AND DATES COVERED March 2000 Master's Thesis 4. TITLE AND SUBTITLE: COM AND XPCOM AS A SOLUTION TO BAMBOO'S VERSIONING 5. FUNDING NUMBERS PROBLEM. 6. AUTHOR Mithat Daglar 7. PERFORMING ORGANIZATION NAME(S) AND ADDRESS(ES) 8. PERFORMING ORGANIZATION Naval Postgraduate School REPORT NUMBER Monterey, CA 93943-5000 9. SPONSORING I MONITORING AGENCY NAME(S) AND ADDRESS(ES) 10. SPONSORINGIMONTI'ORING AGENCY REPORT NUMBER 11. SUPPLEMENTARY NOTES The views expressed in this thesis are those of the authors and do not reflect the official policy or position of the Department of Defense or the U.S. Government. 12a. DISTRIBUTION I AVAILABILITY STATEMENT 12b. DISTRIBUTION CODE Approved for public release; distribution is unlimited. 13. ABSTRACT (maximum 200 words) Bamboo is a systems toolkit that is primarily concerned with supporting performance-critical applications that must run continuously for extremely long periods of time. Bamboo supports this by managing the loading and unloading of executable code into and out of process memory at runtime. Thus, as application requirements change over time, obsolete code can be replaced without having to restart the application. This technique's flexibility has already been demonstrated, but fails in one critical way. Although the C++ programming language standard defines a consistent syntax, it fails to specify a consistent binary encapsulation. Thus, if the executable code for a C++ base class is dynamically replaced, it is very likely that its in memory layout differs from before and therefore incompatible with whatever derived classes may exist. The only recourse is to recompile and reload the derived classes as well. Component Object Model (COM) and Cross Platform Object Model (XPCOM) solve C++'s weakness by enforcing a complete separation of a class's interface from its implementation. This thesis demonstrates support for dynamic versioning of Bamboo C++ modules using COM and XPCOM. 14. SUBJECT TERMS The versioning Problem, Component Object Model, Cross Platform Object Model 15. NUMBER OF PAGES 140 16. PRICE CODE 20. LIMITATION OF ABSTRACT 17. SECURITY CLASSIFICATION 18. SECURITY CLASSIFICATION 19. SECURITY CLASSIFI· OF REPORT OF THIS PAGE CATION OF ABSTRACT UL Unclassified Unclassified Unclassified NSN 7540-01-280-5500 Standard Form 298 (Rev. 2-89) Prescribed by ANSI Std. 239-18 298-102 ,,,\ ii ~~------- r-------------------------------~-- - Approved for public release; distribution is unlimited COM AND XPCOM AS A SOLUTION TO BAMBOO'S VERSIONING PROBLEM Mithat Daglar Lieutenant Junior Grade, Turkish Navy B.S., Turkish Naval Academy, 1993 Submitted in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE IN COMPUTER SCIENCE from the NAVAL POSTGRADUATE SCHOOL March 2000 Author: Approved by: 111 iv ABSTRACT Bamboo is a systems toolkit that is primarily concerned with supporting performance-critical applications that must run continuously for extremely long periods of time. Bamboo supports this by managing the loading and unloading of executable code into and out of process memory at runtime. Thus, as application requirements change over time, obsolete code can be replaced without having to restart the application. This technique's flexibility has already been demonstrated, but fails in one critical way. Although the C++ programming language standard defines a consistent syntax, it fails to specify a consistent binary encapsulation. Thus, if the executable code for a C++ base class is dynamically replaced, it is very likely that its in memory layout differs from before and therefore incompatible with whatever derived classes may exist. The only recourse is to recompile and reload the derived classes as well. Component Object Model (COM) and Cross Platform Object Model (XPCOM) solve C++'s weakness by enforcing a complete separation of a class's interface from its implementation. This thesis demonstrates support for dynamic versioning of Bamboo C++ modules using COM and XPCOM. v vi TABLE OF CONTENTS I. INTRODUCTION .......................................................................................... 1 A. MOTIVATION ....................................................................................... 1 B. BACKGROUND .................................................................................... 1 1. The Versioning Problem ............................................................... 1 2. Bamboo and Reusability ............................................................... 3 C. THESIS STATEMENT .......................................................................... 7 D. CHAPTERS OVERVIEW ...................................................................... 7 II. RELATED WORK .......................................................................................... 9 A. INTRODUCTION .................................................................................. 9 B. SEPARATING INTERFACE AND IMPLEMENTATION ........................ 9 C. CURRENT SOLUTIONS FOR THE VERSION lNG PROBLEM .......... 10 1. C Wrappers around C++ API ...................................................... 10 2. CORBA ....................................................................................... 11 3. COM ........................................................................................... 13 a. Definition and Fundamentals ............................................... 13 b. Binary Standard for Function Calling ................................... 15 c. Interfaces and Interface Definition Language ..................... 18 d. Run-time Type Discovery ..................................................... 19 e. Component and Interface Identifications ............................. 21 f. Object Registration and Creation .......................................... 22 g. Reusability ........................................................................... 23 D. MICROSOFT AND THE VERSION lNG PROBLEM ............................ 25 E. MOZILLA AND THE VERSIONING PROBLEM .................................. 27 F. SUMMARY ......................................................................................... 28 vii Ill. DESIGN .................................................................................................... 29 A. INTRODUCTION ................................................................................ 29 B. PROPER SOLUTION FOR BAMBOO'S VERSIONING PROBLEM ... 29 1. Using C Wrappers around C++ API.. .......................................... 30 2. COM and CORBA ....................................................................... 32 C. UNSAFE MODULES IN BAMBOO ...................................................... 35 D. APPLYING COM AND XPCOM TO BAMB00 .................................... 37 E. SUMMARY .......................................................................................... 40 IV. IMPLEMENTATION ................................................................................... 41 A. INTRODUCTION ................................................................................ 41 B. NONCOMMODULE IMPLEMENTATION ............................................ 41 1. NonCOMPersonCiassModule ..................................................... 41 2. NonCOMStudentCiassModule .................................................... 42 3. NonCOMTestModule .................................................................. 43 C. [XP]COMMODULE IMPLEMENTATION ........................................... .43 1. [XP]COMPersonCiassModule ................................................... .43 a. Writing the Person Object's Interface .................................. 44 b. Compiling the IPerson.idl File .............................................. 47 c. Declaration of the Person Class ........................................... 47 d. Implementation of the Person Class .................................... 49 e. Declaration of Person Factory .............................................. 52 f. Implementing the Global Functions ...................................... 54 g. Writing a Make File .............................................................. 56 h. Registering the Person Object ............................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages142 Page
-
File Size-