Plan of these slides � 1 � 8 Overview Ext er nal int er f ace Eif f el in Depth � 2 � 9 The environment (s) Agent s � 3 � 10 Met hod overview Advanced design � 4 � 11 Language basics Advanced mechanisms � 5 � 12 Dynamic model Conclusion Bertrand Meyer � 6 � 13 Genericit y & Supplement s inherit ance Emmanuel Stapf (Eif f el Sof tware) � 7 Design by Cont r act ™ Pei Yu & members of the ETH Chair of Sof tware Engineering Chair of Sof t w are Engineering 2 Course organization Purpose of this course Course page: To give you an in-dept h under st anding of a sof t war e met hod, language and environment : Eif f el (and ht t p:/ / se.inf .et hz.ch/ t eaching/ 2009-H/ eif f el-0291/ index.ht ml Eif f elSt udio) Teaching st af f : To improve your under st anding of sof t war e engineer ing � Lect urer: Bert rand Meyer & members of t he Chair of and sof t war e ar chit ect ur e Sof t war e Engineer ing To give you a f eel f or t he challenges involved in bot h � Course assist ant : Yu (Max) Pei sof t war e design and language design Grading: 70% proj ect , 30% exam Proj ect will be a web-based syst em using t he new Eif f elWeb Exam will be on last lect ure slot of t he semest er: 15 Dec. 3 4 The softw are of the future Product qualit y - 1 - � Correct ness � Robust ness � Secur it y Overview Process qualit y � Fast development � No semant ic gap (“impedance mismat ch”) bet ween developers and ot her st akeholders � Self -validat ing, self -t est ing � Ease of change � Reusabilit y 5 6 1
Language versions Why Eiffel? Eif f el 1, 1986 Product ivit y: f ast er t ime t o market , f ewer developers Classes, cont r act s, genericit y, single and mult iple inherit ance, garbage collect ion, … Reliabilit y: f ewer bugs Eif f el 2, 1988 ( Obj ect -Or ient ed Sof t ware Const r uct ion ) Except ions, const rained genericit y Ext endibilit y: be responsive t o cust omer needs Eif f el 3, 1990-1992 ( Eif f el: The Language ) Basic t ypes as classes, inf ix & pref ix oper at ors… Reuse: st and on t he shoulder of giant s Eif f el 4, 1997 “P recur sor” and agent s Ef f iciency: make t he best use of hardware resources Eif f el 5, ECMA St andard, 2005, revised 2006, and I SO Maint ainabilit y: spend your t ime on new development s st andard, November 2006 www.ecma-int er nat ional.org/ publicat ions/ st andards/ Ecma-367.ht m At t ached t ypes, conversion, assigner commands… 7 8 Eiffel: Method, Language, Environment Some typical users Met hod : Axa Rosenberg � Applicable t hroughout t he lif ecycle I nvest ment management : f r om $ 2 billion t o > $ 100 billion � Obj ect -orient ed t o t he core 2 million lines The Chicago Boar d of Tr ade � Seamless development Chicago Boar d of Tr ade � Based on Design by Cont ract ™ principles Price report ing syst em Language : Eif f el + CORBA + � Full power of obj ect t echnology Solar is + Windows + … See: � Simple yet powerf ul, numerous original f eat ur es Xont ech (f or Boeing) eif f el.com � I SO st andard (2006) (Eif f el) Price Lar ge-scale simulat ions Report ing Syst em Envir onment : of missile def ense � I nt egrat ed, provides single solut ion, including Nort hrop-Grumman analysis and modeling � Lot s of plat f orms (Unix, Windows, VMS, .NET… ) Swedish social securit y: accident report ing & management � Open and int eroperable 9 10 Learning Eiffel The Eiffel method: some principles � Abst r act ion � Simple synt ax, no cr ypt ic symbols � I nf ormat ion hiding Eif f el pr ogr ammer s know all of Eif f el � Seamlessness � Wide var iet y of user backgrounds � Reversibilit y “ I f you can writ e a condit ional, � Design by Cont ract you can wr it e a cont r act ” � Open-Closed pr inciple � Fast lear ning cur ve � Single choice pr inciple � Single model pr inciple � Lot s of good models t o learn f rom � Unif or m access principle � St r ong st yle rules � Command-query separ at ion pr inciple � Opt ion-operand separ at ion pr inciple � May need t o “unlearn” needless t ricks � St yle mat t er s ... See next ... 11 12 2
The Eiffel language Libraries � Classes � Fundament al dat a st r uct ur es and algor it hms � Unif orm t ype syst em, covering basic t ypes � Por t able gr aphics � Genericit y � I nt ernet , Web � I nher it ance, single and mult iple � Lexical analysis, par sing � Conversion � Dat abase int erf aces � Covar iance � St at ically t yped � Built -in Design by Cont r act mechanisms � Agent s: obj ect s encapsulat ing behavior � “Once” mechanisms, replacing st at ics and globals � Void saf et y (new!) 13 14 Dogmatism and flexibility The Eiffel language: there is a hidden agenda Dogmat ic wher e it count s: � I nf ormat ion hiding (e.g. no x . a := b ) � Over loading � “One good way t o do anyt hing” � St yle rules That you f orget it even exist s Flexible when it makes no point t o har ass pr ogr ammer s: � Give st andar d not at ions (e.g. a + b ) an O-O int erpr et at ion � Synt ax, e.g. semicolon 15 16 EiffelStudio Eif f elBuild Eif f elBase GUI builder General library User - 2 - classes Eif f elVision Browsing, f ast compiling � Persistent (Melting I ce™), debugging, Multiplatf orm GUI library objects diagrams, met rics. . . WEL Serializat ion Win32 library The environment Ansi C C compilation Eif f elWeb Executable Eif f el compilation Eif f elStudio Web development Jitter system I L Eif f elMath EiffelStore Advanced numerics Eif f el Eif f elNet Runtime Dat abases Networking Ext ernal . NET (Rel, OO) Eif f elCOM C/ C++/ Java Assemblies 17 18 3
EiffelStudio: Melting Ice™ Technology Melting Ice Technology Eif f elSt udio Your syst em Fast recompilat ion: t ime depends on Small Big size of change, not change change Freeze FROZEN size of pr ogr am Small pr ogr am Machine code (f r om C code) Full t ype checking Edit, browse, execute, debug, test… Lar ge pr ogr am “Fr eeze” once in a Melt while MELTED Opt imized compilat ion: f inalize. 19 20 Performance EiffelStudio brow sing and debugging “Finalizat ion” mode of compilat ion applies ext ensive You are dealing wit h “development obj ect s”: opt imizat ions: � I nlining � Classes � Dead code r emoval � Feat ures � Cont r act r emoval � Run-t ime obj ect s (f or debugging) � ... Opt imizat ions ar e compiler-applied and aut omat ic; no need To work on an obj ect , “pick-and-drop” it int o an f or manual hacking appropriat e t ool Compact ing garbage collect ion t akes care of memory issues I nt ended t o mat ch t he most exact ing demands of indust r y applicat ions 21 22 Openness C/C++ support Funct ions, macros, include f iles, set t ers, get t ers, Eif f el can be used as “component combinat or” t o package const r uct ors, dest ruct ors et c. element s f rom dif f er ent sources: I nline C � Mechanisms f or int egrat ing element s in C, C++, J ava, CI L (.NET) � I nt er f aces and libraries: SQL, XML, UML (XMI ), CORBA, COM, ot her s From t he out side int o Eif f el: � Par t icular ly sophist icat ed mechanisms f or C/ C++ � CECI L (C-Eif f el Common I nt erf ace Library) int er f acing � Out side of .NET, compiles down t o ANSI C code, f acilit at es suppor t f or C and C++ easier . � On .NET, seamless int egr at ion wit h C# , VB .NET et c. 23 24 4
Portability Source- code port abilit y across: - 3 - � Windows NT, 2000, XP, Vist a � Windows 98, Me � .NET The met hod � Solar is, ot her commer cial Unix var iant s � Linux � Mac OS X (f ort hcoming) � BSD (Berkeley Syst em Dist ribut ion) � VMS 25 26 Traditional lifecycle model The w aterfall model of the lifecycle Feasibilit y Rigid model: Feasibilit y st udy st udy � Wat er f all: separ at e t asks, Requirement s impedance mismat ches Requirement s � Var iant s, e.g. spir al, r et ain Specif icat ion some of t he pr oblems Specif icat ion Separ at e t ools: Global design Global design � Pr ogr amming envir onment � Analysis & design t ools, e.g. UML Det ailed design Det ailed design Consequences: I mplement at ion � Har d t o keep model, implement at ion, I mplement at ion document at ion consist ent � Const ant ly r econciling views V & V V & V � I nf lexible, har d t o maint ain syst ems � Har d t o accommodat e bout s of lat e wisdom Deployment Deployment � Wast es ef f or t s � Damages qualit y 27 28 Seamlessness The Eiffel model Example classes: Seamless development : Seamlessness Principle P LANE, ACCOUNT, � Single not at ion, t ools, Analysis TRANSACTI ON… concept s, pr inciples t hroughout STATE, COMMAND… � Eif f el is as much f or analysis & Sof tware development should rely Design design as implement at ion & maint enance on a single set of notations & tools I mplemen- HASH_TABLE… � Cont inuous, incr ement al t at ion development � Keep model, implement at ion TEST_DRI VER… and document at ion consist ent V&V � Rever sibilit y: go back & f or t h Generali- � Saves money: invest in single TABLE… set of t ools zat ion � Boost s qualit y 29 30 5
Recommend
More recommend