1 / 8

Software Engineering Lecture 4

Software Engineering Lecture 4. Vladimir Safonov , Professor, head of laboratory St. Petersburg University Email: v_o_safonov@mail.ru WWW: http://user.rol.ru/~vsafonov. The role of the programming paradigms under consideration.

pisces
Download Presentation

Software Engineering Lecture 4

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. SoftwareEngineeringLecture 4 Vladimir Safonov, Professor, head of laboratory St. Petersburg University Email: v_o_safonov@mail.ru WWW: http://user.rol.ru/~vsafonov

  2. The role of the programming paradigms under consideration • Structured programming – systematic design and development of (mainly) the control flow parts (statements) • Stepwise refinement – convenient top-down technique of rapid application prototyping • Modular programming – systematicprogram decomposition into relatively independent parts (modules) • Also of great importance aretechniques for design and development of data types and structures (C) Vladimir O. Safonov, 2004

  3. Abstract Data Types (ADT) • Founders (1970s): - Sir Tony Hoare: Oxford University , MSR; - Prof. Barbara Liskov: Massachusetts Institute of Technology - Prof. David Parnas (U.S. and Canadian universities) • Basic principles - Type = concrete representation+ set of abstract operations - Direct access to concrete representation is not allowed - Handling values (or objects) of the typeT is possible only via its abstract operationsP1, … Pn, so the type T is encapsulated • ADT can be regarded as a kind of modularity (name and set of operations – interface; concrete representation and bodies of operations – implementations • Before ADTsimilar approach was applied topredefined (primitive) types: VAR i: INTEGER; BEGIN … i := i+1; … END (C) Vladimir O. Safonov, 2004

  4. ADT specifics • “Types are not sets” (F. Morris) • Encapsulation • Formal specification of ADT semantics necessary • R. Floyd’s – C.A.R. Hoare’s method: P { S } Q • Denotational semanticsof ADT (D. Scott, J. Donahue): program is a transformer of predicates the kind:P(X1, … Xn), whereXi – set of variables • Algebraic specification of ADT (theADJ group, lead – prof. J.A. Goguen, the author of OBJ specification language): type – multi-sorted algebra; S1, … Sk – sorts (carrier); P1, …, Pm – operations (signature); semantics – set of equates of the kind:T1 = T2 where T1 and T2 - terms (C) Vladimir O. Safonov, 2004

  5. ADT advantages • Modularity • Increasing reliability • Formal specification and verification of ADT • ADT libraries and reusability (C) Vladimir O. Safonov, 2004

  6. ADT issues and how to solve them • “ADT are non-efficient” (each abstract operation is a routine!) -> using macros and inline routines; program optimization (the task of the compiler rather than user) • “ADT are too complicated” (it seems simpler to code “from scratch” and to write explicitly something like: P^.X [index]^.Y := something ) -> such “coding technique” leads to buggy and non-readable programs. ADT is a comfortable technique of abstraction from details: SetMyProp(P, something); (C) Vladimir O. Safonov, 2004

  7. ADT languages • FORTRAN & PASCAL  - predefined types are regarded as ADT with infix:X+Y or functional:SIN(X) style of operations • CLU (B. Liskov) – the first ADT language; played outstanding partin all subsequent development ofprogramming languages – M.I.T., 1974 • ALPHARD (M. Shaw, Carnegie-Mellon Univ.) – the“competitive project” toCLU; based on similar ideas, butHoare-style specification and verification added to the language • Ada (package, task); Modula-3 (interface); Java, C# … - contain elements of ADT concept (C) Vladimir O. Safonov, 2004

  8. References and home task to lecture 4 • Please read the following papers and get acquainted to their approached to ADT: • Liskov B, Guttag J. Using abstractions and specifications in program development. – Addison-Wesley, 1986 • Hoare, C.A.R. Proof of correctness of data representation (article, 1972) (C) Vladimir O. Safonov, 2004

More Related