7/24/2019 eiffel_for_dotnet.ppt
1/23
Languages for .NET: EiffelLanguages for .NET: Eiffel
Raphael Simon (ISE)Raphael Simon (ISE)
Emmanuel Stapf (ISE)Emmanuel Stapf (ISE)
7/24/2019 eiffel_for_dotnet.ppt
2/23
IntroductionIntroduction
Initially (P! "###$ ISE Eiffel %.#): supportInitially (P! "###$ ISE Eiffel %.#): support
for Eiffel su&setfor Eiffel su&set
Planned for "##": full EiffelPlanned for "##": full Eiffelimplementationimplementation
Integrated 'ith the ISE Eiffel enironmentIntegrated 'ith the ISE Eiffel enironment
7/24/2019 eiffel_for_dotnet.ppt
3/23
Today: EiffelToday: Eiffel
sed in financial institutions:sed in financial institutions: !hicago *oard of Trade!hicago *oard of Trade +,a+,a
!+L-P!+L-P sed for simulation:sed for simulation:
*attle field simulation (onTech Inc)*attle field simulation (onTech Inc) +tmosphere simulation (EP+)+tmosphere simulation (EP+)
Payroll systems:Payroll systems: /roupe S/roupe S !+P /emini (no' Ernst01oung)!+P /emini (no' Ernst01oung)
7/24/2019 eiffel_for_dotnet.ppt
4/23
Today: Eiffel for .NETToday: Eiffel for .NET
Eiffel for .NET includes:Eiffel for .NET includes: 2a3or Eiffel language mechanisms2a3or Eiffel language mechanisms
!ontracts (assertions)!ontracts (assertions)
E,ception handlingE,ception handling /enericity/enericity
!oariance!oariance
oes not include:oes not include: +gents (closures$ cf. elegates)+gents (closures$ cf. elegates)
2ultiple inheritance2ultiple inheritance
/eneric conformance/eneric conformance
7/24/2019 eiffel_for_dotnet.ppt
5/23
Eiffel li&rariesEiffel li&raries
Eiffel*ase compati&le ersion for .NETEiffel*ase compati&le ersion for .NET ses interfaces to represent multipleses interfaces to represent multiple
inheritance used in Eiffel*aseinheritance used in Eiffel*ase
4##5 compati&le 'ith Eiffel*ase at the client4##5 compati&le 'ith Eiffel*ase at the client
leelleel
ses natiely .NET li&raries (importedses natiely .NET li&raries (imported
through the +ssem&ly 2anager)through the +ssem&ly 2anager)
7/24/2019 eiffel_for_dotnet.ppt
6/23
.NET special additions to Eiffel.NET special additions to Eiffel
E,tended inde,ing clauses to represent:E,tended inde,ing clauses to represent: E,ternal names: names as they 'ill &e seenE,ternal names: names as they 'ill &e seen
&y the .NET 'orld&y the .NET 'orld
!ustom attri&utes!ustom attri&utes
Ne' class 6ualification to represent:Ne' class 6ualification to represent: Sealed classesSealed classes
.NET classes (imported from an assem&ly).NET classes (imported from an assem&ly)
7/24/2019 eiffel_for_dotnet.ppt
7/23
Inde,ing clauses: classesInde,ing clauses: classes
inde,inginde,ing
e,ternal7name: 8System.String8e,ternal7name: 8System.String8
attri&ute:attri&ute:createcreate9*SLETE7+TTRI*TE;9*SLETE7+TTRI*TE;
.ma
7/24/2019 eiffel_for_dotnet.ppt
8/23
Inde,ing clauses: routinesInde,ing clauses: routines
featurefeature
some7routine (i: INTE/ER) issome7routine (i: INTE/ER) is
inde,inginde,inge,ternal7name: 8SomeRoutine8e,ternal7name: 8SomeRoutine8
attri&ute:attri&ute:
createcreate9*SLETE7+TTRI*TE;9*SLETE7+TTRI*TE;
.ma
endend
7/24/2019 eiffel_for_dotnet.ppt
9/23
ld Eiffel class 6ualificationld Eiffel class 6ualification
??e,pandede,panded@@ deferreddeferredAA classclass
Simplified synta,:Simplified synta,:
+n e,ample:+n e,ample:
inde,inginde,ing
description: 8Se6uence of characters8description: 8Se6uence of characters8
classclass
STRIN/STRIN/
7/24/2019 eiffel_for_dotnet.ppt
10/23
Ne' Eiffel class 6ualificationNe' Eiffel class 6ualification
Inde,ingInde,ing
description: 8Se6uence of characters8description: 8Se6uence of characters8
e,ternal7name: 8System.String8e,ternal7name: 8System.String8
fro=enfro=ene,ternale,ternalclassclass
STRIN/STRIN/
????fro=enfro=enA ?A ?e,pandede,pandedA @A @ deferreddeferredA ?A ?e,ternale,ternalAA classclass
Simplified synta,:Simplified synta,:
+n e,ample:+n e,ample:
7/24/2019 eiffel_for_dotnet.ppt
11/23
+ccessing .NET facilities+ccessing .NET facilities
!reation of the assem&ly manager to!reation of the assem&ly manager to
automatically generate Eiffel classautomatically generate Eiffel class
s
7/24/2019 eiffel_for_dotnet.ppt
12/23
+ccessing .NET facilities+ccessing .NET facilities
Properties: +ssem&ly 2anager 'illProperties: +ssem&ly 2anager 'illgenerate the get7,, and set7,, featuresgenerate the get7,, and set7,, featuresassociated to the B,,C property .associated to the B,,C property .
Eents: same as properties$ 'e generateEents: same as properties$ 'e generatethe add7,,$ remoe7,, and fire7,,the add7,,$ remoe7,, and fire7,,features.features.
erloaded methods: +ssem&ly 2anagererloaded methods: +ssem&ly 2anager'ill generate a different name isi&le at'ill generate a different name isi&le atthe Eiffel leel
7/24/2019 eiffel_for_dotnet.ppt
13/23
Eiffel: a first class !LS citi=enEiffel: a first class !LS citi=en
!LS: !ommon Language Specification!LS: !ommon Language Specification
Language interopera&ility achieedLanguage interopera&ility achieed
through a set of !LS rulesthrough a set of !LS rules .NET li&rary authors should
7/24/2019 eiffel_for_dotnet.ppt
14/23
Eiffel constructs seen from !LSEiffel constructs seen from !LS
+ttri&utes are generated as properties+ttri&utes are generated as properties
/eneric classes: one .NET class per generic/eneric classes: one .NET class per generic
deriation of e,panded types and one .NETderiation of e,panded types and one .NET
class for all generic deriation of referenceclass for all generic deriation of referencetypes.types.
LIST ?INTE/ERALIST ?INTE/ERA DD LIST7System7IntF"LIST7System7IntF"
LIST ?!G+R+!TERALIST ?!G+R+!TERA DD LIST7System7!harLIST7System7!har
LIST ?+N1ALIST ?+N1A DD LIST7System7&3ectLIST7System7&3ect
7/24/2019 eiffel_for_dotnet.ppt
15/23
!LS issues!LS issues
Eiffel creation routines do not match !LIEiffel creation routines do not match !LI
constructors:constructors:
T'o creation routines might hae the sameT'o creation routines might hae the same
signaturesignature
!reation routine need not call the parent!reation routine need not call the parent
creation routinecreation routine
Gard to consume B&yrefC parameterGard to consume B&yrefC parameter
Eiffel features e,portation rules areEiffel features e,portation rules are
different of the !LI ones.different of the !LI ones.
7/24/2019 eiffel_for_dotnet.ppt
16/23
Eiffel issuesEiffel issues
2ultiple inheritance of classes is not yet2ultiple inheritance of classes is not yet
supported. 2any possi&le 'ays:supported. 2any possi&le 'ays:
Implementation of your o'n dynamicImplementation of your o'n dynamicdispatch. *arely usa&le for other !LSdispatch. *arely usa&le for other !LS
languages.languages.
Promote all multiply inherited classes toPromote all multiply inherited classes to
interfaces. Performance penalty andinterfaces. Performance penalty and&ehaior differences.&ehaior differences.
7/24/2019 eiffel_for_dotnet.ppt
17/23
2ultiple inheritance through interfaces2ultiple inheritance through interfaces
Inconenience of using the interfaceInconenience of using the interface
definition instead of the class directly.definition instead of the class directly.
Performance penalty:Performance penalty: eery call is irtual instead of &eing optimi=edeery call is irtual instead of &eing optimi=ed
inlining &ecomes difficultinlining &ecomes difficult
7/24/2019 eiffel_for_dotnet.ppt
18/23
2ultiple inheritance through interfaces2ultiple inheritance through interfaces
*ehaior of repeated inheritance is not*ehaior of repeated inheritance is not
identical:identical:
A
CB
D
f
g h
select g
c: !H d: c: !H d: c : dc : d
c.h JJc.h JJ
In Eiffel:In Eiffel:ersion g of (inherited from *) is calledersion g of (inherited from *) is called
In .NET:In .NET:
ersion h of (inherited from !) is calledersion h of (inherited from !) is called
7/24/2019 eiffel_for_dotnet.ppt
19/23
Kerifia&ilityKerifia&ility
efault generation is erifia&leefault generation is erifia&le
ser can specify other'ise:ser can specify other'ise:
-or &etter performance-or &etter performance -or priate usage-or priate usage
7/24/2019 eiffel_for_dotnet.ppt
20/23
Eiffel for .NET future additionEiffel for .NET future addition
!reation of .NET properties!reation of .NET properties
!reation of .NET eents!reation of .NET eents
!reation of ne' type of elegates!reation of ne' type of elegates
7/24/2019 eiffel_for_dotnet.ppt
21/23
Eiffel and Eiffel for .NETEiffel and Eiffel for .NET
!alling Eiffel from Eiffel for .NET:!alling Eiffel from Eiffel for .NET: !reating !2 components of e,isting Eiffel!reating !2 components of e,isting Eiffel
applicationapplication
irect calls to Eiffel ! generated codeirect calls to Eiffel ! generated code
automatically handled &y the Eiffel for .NETautomatically handled &y the Eiffel for .NET
compilercompiler
!alling Eiffel for .NET from Eiffel:!alling Eiffel for .NET from Eiffel: sing !2 interopsing !2 interop
7/24/2019 eiffel_for_dotnet.ppt
22/23
.NET i=ard.NET i=ard
Gelps start a ne' Eiffel for .NET pro3ectGelps start a ne' Eiffel for .NET pro3ect
Integrated into EiffelStudioIntegrated into EiffelStudio
7/24/2019 eiffel_for_dotnet.ppt
23/23
+ssem&ly 2anager+ssem&ly 2anager
+aila&le at any time from EiffelStudio+aila&le at any time from EiffelStudio
+llo's to:+llo's to:
Edit e,ternal classes feature namesEdit e,ternal classes feature names
Import ne' assem&lies in the Eiffel +ssem&lyImport ne' assem&lies in the Eiffel +ssem&ly
!ache (!ache (EACEAC))
Remoe assem&lies from the E+!Remoe assem&lies from the E+!
Recommended