A Programming Language for Software Components Pdfauthor

A Programming Language for Software Components Pdfauthor

A Programming Language for Software Components Simon D. Kent, B.App.Sci.(Math), B.Inf.Tech. March 2010 A dissertation submitted in partial fulfillment of the requirements for the degree Doctor of Philosophy in Computer Science OUT Faculty of Science and Technology Queensland University of Technology Brisbane, Australia Copyright c Simon D. Kent, MMX. All rights reserved. simon d [email protected] The author hereby grants permission to the Queensland University of Technology to reproduce and distribute publicly paper and electronic copies of this thesis document in whole or in part. \They say the heat and the flies here can drive a man insane. But you don't have to believe that, and nor does that bright mauve elephant that just cycled past." Terry Pratchett (The Last Continent) Keywords Software Components, Programming Languages, Specifications, Interfaces, Modules, State, Re-entrance Abstract Component software has many benefits, most notably increased software re-use; however, the component software process places heavy burdens on programming language techno- logy, which modern object-oriented programming languages do not address. In particular, software components require specifications that are both sufficiently expressive and suffi- ciently abstract, and, where possible, these specifications should be checked formally by the programming language. This dissertation presents a programming language called Mentok that provides two novel programming language features enabling improved specification of stateful com- ponent roles. Negotiable interfaces are interface types extended with protocols, and allow specification of changing method availability, including some patterns of out-calls and re-entrance. Type layers are extensions to module signatures that allow specifica- tion of abstract control flow constraints through the interfaces of a component-based application. Development of Mentok's unique language features included creation of MentokC, the Mentok compiler, and formalization of key properties of Mentok in mini-languages called MentokP and MentokL. Contents List of Figures xvii List of Listings xix 1 Introduction1 1.1 Software Components............................2 1.1.1 Benefits of Component Software..................2 1.1.2 Requirements of Component Software...............3 1.2 Component Specifications..........................5 1.2.1 Component Specification and Programming Languages......6 1.3 Research Question..............................6 1.4 Contribution and Approach.........................7 1.5 Structure of the dissertation.........................7 2 Background: Software Components9 2.1 Foundation Technologies...........................9 2.1.1 Object Technology.......................... 10 2.1.2 Modules................................ 14 2.1.3 Cross-Cutting Concerns....................... 14 2.1.4 Trust and Safety........................... 15 2.2 Industry Component Standards....................... 16 2.2.1 Microsoft: COM to .NET...................... 17 2.2.2 Java, EJB, J2/Java EE, and Eclipse................ 18 2.2.3 OMG: CORBA to CCM....................... 19 2.3 Components and Programming Languages................. 19 2.3.1 Programming languages....................... 20 2.4 Components, Specification and Design................... 22 2.4.1 Programming by contract...................... 23 2.5 Related Fields................................. 25 2.5.1 ADLs and BISLs........................... 25 2.5.2 Coordination Languages....................... 27 2.5.3 Protocols, Models and Objects................... 28 ix Contents 2.5.4 Model Checking........................... 31 3 Scope, Problem and Solution 33 3.1 A Basic Programming Model for Software Components.......... 34 3.1.1 Notes on Component Pascal..................... 35 3.1.2 Interface Model............................ 36 3.1.3 Object Model............................. 38 3.1.4 Module Model............................ 41 3.2 Problems with the Basic Model: State and Object Consistency..... 42 3.2.1 Static Interface Types: Static Method Availability........ 43 3.2.2 Static Module Signatures: Static Interface Availability...... 49 3.3 Research Question.............................. 53 3.4 Mentok: Enhanced Specifications...................... 53 3.4.1 Negotiable Interfaces: Dynamic Method Availability....... 54 3.4.2 Type Layers: Dynamic Interface Availability........... 60 3.5 Summary................................... 65 4 Negotiable Interfaces 67 4.1 Negotiable Interfaces in Mentok....................... 68 4.1.1 Negotiable Interface Types..................... 69 4.1.2 Objects and Negotiation....................... 78 4.1.3 State System............................. 84 4.2 A Formal Model of Negotiable Interfaces: MentokP ........... 87 4.2.1 Isabelle and Notation........................ 91 4.2.2 MentokP Programs......................... 91 4.2.3 Program Well-Formedness...................... 94 4.2.4 Type System............................. 95 4.2.5 State System............................. 98 4.2.6 Operational Semantics........................ 102 4.2.7 Results................................ 106 4.3 Implementation: Negotiable Interfaces and the Mentok Compiler.... 109 4.3.1 Structure of the Compiler...................... 109 4.3.2 Runtime Representations...................... 110 4.4 Discussion: Problems and Extensions.................... 116 4.4.1 Multiple Behaviours......................... 118 4.4.2 Non-determinism........................... 120 4.4.3 Reachability and Empty Types................... 121 4.5 Related Work................................. 121 4.6 Summary................................... 123 x Contents 5 Type Layers 125 5.1 Type Layers in Mentok........................... 126 5.1.1 Type and Component Layers.................... 127 5.1.2 Composition Model......................... 131 5.1.3 Execution model........................... 133 5.2 A Formal Model of Type Layers...................... 137 5.2.1 MentokL Programs......................... 137 5.2.2 Program Well-Formedness...................... 138 5.2.3 State System............................. 139 5.2.4 Operational Semantics........................ 139 5.3 Implementation: Type Layers and the Mentok Compiler......... 140 5.3.1 Structure of the Compiler...................... 140 5.3.2 Runtime Representations and Dynamic Checking......... 141 5.4 Discussion: Problems and Extensions.................... 143 5.4.1 Reachability.............................. 144 5.4.2 Recursive Data Structures...................... 144 5.5 Related Work................................. 145 5.6 Summary................................... 146 6 Conclusions and Future Work 147 6.1 Future Work................................. 149 A MentokP : A language with negotiable interfaces 151 A.1 Names and Identifiers............................ 152 A.2 Types in MentokP .............................. 153 A.2.1 Type definitions........................... 153 A.2.2 Type tests and functions....................... 153 A.3 Primitive Values............................... 155 A.3.1 Types of values............................ 155 A.3.2 Default values............................. 156 A.4 State Declarations.............................. 157 A.4.1 Declarations.............................. 157 A.4.2 Valuations............................... 157 A.4.3 Well-formedness........................... 157 A.4.4 Token Bag partial ordering..................... 158 A.5 Expressions and Statements in MentokP .................. 159 A.5.1 Terms................................. 160 A.5.2 Predicates and Functions Over Terms............... 161 A.6 Programs in MentokP ............................ 165 xi Contents A.6.1 Method Declarations and Implementations............ 165 A.6.2 Interface Bodies........................... 165 A.6.3 Record Bodies............................ 166 A.6.4 Programs............................... 166 A.6.5 lookups................................ 167 A.6.6 Type well-formedness........................ 167 A.6.7 Lookup functions........................... 168 A.6.8 Negotiable State Well-formedness.................. 169 A.7 Type Relationships.............................. 172 A.7.1 Interface Implementation...................... 172 A.7.2 Type widening............................ 172 A.7.3 Type results.............................. 172 A.8 Static Environments............................. 174 A.8.1 Environment definitions....................... 174 A.8.2 Operations on State Environments................. 174 A.8.3 Environment creation........................ 175 A.9 Type System Rules for Expressions and Statements............ 179 A.10 State System Rules for Expressions and Statements............ 182 A.10.1 Stateful parameter checking..................... 182 A.10.2 State checking............................ 182 A.11 Program Well-Formedness.......................... 186 A.11.1 Well-formed type lists........................ 186 A.11.2 Well-formed field declarations.................... 186 A.11.3 Well parameter behaviour lists................... 186 A.11.4 Well-formed method types...................... 186 A.11.5 Well-formed method type lists................... 186 A.11.6 Well-formed method declaration lists................ 187 A.11.7 Well-formed interface bodies.................... 187 A.11.8 Well formed method bodies..................... 187 A.11.9 Well-formed record bodies...................... 187 A.11.10Well-formed variable declarations.................. 188 A.11.11Well-formed programs........................ 188 A.12 Runtime Structures and Operations...................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    253 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us