1 / 23

Languages for .NET: Eiffel

Languages for .NET: Eiffel. Raphael Simon (ISE) Emmanuel Stapf (ISE). Introduction. Initially (PDC 2000, ISE Eiffel 5.0): support for Eiffel subset Planned for 2002: full Eiffel implementation Integrated with the ISE Eiffel environment. Today: Eiffel. Used in financial institutions:

edolie
Télécharger la présentation

Languages for .NET: Eiffel

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Languages for .NET: Eiffel Raphael Simon (ISE) Emmanuel Stapf (ISE)

  2. Introduction • Initially (PDC 2000, ISE Eiffel 5.0): support for Eiffel subset • Planned for 2002: full Eiffel implementation • Integrated with the ISE Eiffel environment

  3. Today: Eiffel • Used in financial institutions: • Chicago Board of Trade • Axa • CALFP • Used for simulation: • Battle field simulation (XonTech Inc) • Atmosphere simulation (EPA) • Payroll systems: • Groupe S • CAP Gemini (now Ernst&Young)

  4. Today: Eiffel for .NET • Eiffel for .NET includes: • Major Eiffel language mechanisms • Contracts (assertions) • Exception handling • Genericity • Covariance • Does not include: • Agents (closures, cf. Delegates) • Multiple inheritance • Generic conformance

  5. Eiffel libraries • EiffelBase compatible version for .NET • Uses interfaces to represent multiple inheritance used in EiffelBase • 100% compatible with EiffelBase at the client level • Uses natively .NET libraries (imported through the Assembly Manager)

  6. .NET special additions to Eiffel • Extended indexing clauses to represent: • External names: names as they will be seen by the .NET world • Custom attributes • New class qualification to represent: • Sealed classes • .NET classes (imported from an assembly)

  7. Indexing clauses: classes indexingexternal_name: "System.String" attribute:create {OBSOLETE_ATTRIBUTE} .make ("Use YY instead") end frozenexternal class MY_CLASS …

  8. Indexing clauses: routines feature some_routine (i: INTEGER) isindexingexternal_name: "SomeRoutine" attribute:create {OBSOLETE_ATTRIBUTE} .make ("Use SomeOtherRoutine instead") end do … end

  9. Old Eiffel class qualification An example: indexingdescription: "Sequence of characters" class STRING Simplified syntax: [expanded | deferred] class

  10. New Eiffel class qualification An example: Indexing description: "Sequence of characters"external_name: "System.String" frozenexternalclass STRING Simplified syntax: [[frozen] [expanded] | deferred] [external] class

  11. Accessing .NET facilities • Creation of the assembly manager to automatically generate Eiffel class skeleton to access .NET facilities • New Eiffel external syntax to access .NET members. • to_string: STRING is external "IL signature ():System.String use System.String" alias "ToString" end

  12. Accessing .NET facilities • Properties: Assembly Manager will generate the get_xx and set_xx features associated to the `xx' property . • Events: same as properties, we generate the add_xx, remove_xx and fire_xx features. • Overloaded methods: Assembly Manager will generate a different name visible at the Eiffel level kept consistently by the Assembly Manager.

  13. Eiffel: a first class CLS citizen • CLS: Common Language Specification • Language interoperability achieved through a set of CLS rules • .NET library authors should know about CLS • Consumers and producers targeting .NET should know about CLS

  14. Eiffel constructs seen from CLS • Attributes are generated as properties • Generic classes: one .NET class per generic derivation of expanded types and one .NET class for all generic derivation of reference types. LIST [INTEGER] -> LIST_System_Int32 LIST [CHARACTER] -> LIST_System_Char LIST [ANY] -> LIST_System_Object

  15. CLS issues • Eiffel creation routines do not match CLI constructors: • Two creation routines might have the same signature • Creation routine need not call the parent creation routine • Hard to consume `byref' parameter • Eiffel features exportation rules are different of the CLI ones.

  16. Eiffel issues • Multiple inheritance of classes is not yet supported. Many possible ways: • Implementation of your own dynamic dispatch. Barely usable for other CLS languages. • Promote all multiply inherited classes to interfaces. Performance penalty and behavior differences.

  17. Multiple inheritance through interfaces • Inconvenience of using the interface definition instead of the class directly. • Performance penalty: • every call is virtual instead of being optimized • inlining becomes difficult

  18. f A g h B C D select g Multiple inheritance through interfaces • Behavior of repeated inheritance is not identical: c: C; d: Dc := dc.h ?? In Eiffel:version g of D (inherited from B) is called In .NET:version h of D (inherited from C) is called

  19. Verifiability • Default generation is verifiable • User can specify otherwise: • For better performance • For private usage

  20. Eiffel for .NET future addition • Creation of .NET properties • Creation of .NET events • Creation of new type of Delegates

  21. Eiffel and Eiffel for .NET • Calling Eiffel from Eiffel for .NET: • Creating COM components of existing Eiffel application • Direct calls to Eiffel C generated code automatically handled by the Eiffel for .NET compiler • Calling Eiffel for .NET from Eiffel: • Using COM interop

  22. .NET Wizard • Helps start a new Eiffel for .NET project • Integrated into EiffelStudio

  23. Assembly Manager • Available at any time from EiffelStudio • Allows to: • Edit external classes feature names • Import new assemblies in the Eiffel Assembly Cache (EAC) • Remove assemblies from the EAC

More Related