当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

上海交通大学:《面向对象软件工程 Software Engineering》课程教学资源(PPT课件讲稿)10.Mapping Models to Code

资源类别:文库,文档格式:PPTX,文档页数:64,文件大小:1.07MB,团购合买
Overview Mapping Concepts Mapping Activities Case Study
点击下载完整版文档(PPTX)

上降文通大学 SHANGHAI JLAO TONG UNIVERSITY 10.Mapping Models to Code 漏 WnnmM 泰 SHANG 1日gG

10. Mapping Models to Code

上游充通大兽 Outline SHANGHAI JIAO TONG UNIVERSITY Overview 国Mapping Concepts ④Mapping Activities Case Study Software Engineering

Software Engineering Outline Overview Mapping Concepts Mapping Activities Case Study

上游充通大兽 1.Overview SHANGHAI JIAO TONG UNIVERSITY Object design is situated between system design and implementation.Object design is not very well understood and if not well done,leads to a bad system implementation. In this lecture,we describe a selection of transformations to illustrate a disciplined approach to implementation to avoid system degradation. 1.Operations on the object model: Optimizations to address performance requirements 2.Implementation of class model components: Realization of associations Realization of operation contracts 3.Realizing entity objects based on selected storage strategy Mapping the class model to a storage schema Software Engineering

Software Engineering 1. Overview Object design is situated between system design and implementation. Object design is not very well understood and if not well done, leads to a bad system implementation. In this lecture, we describe a selection of transformations to illustrate a disciplined approach to implementation to avoid system degradation. 1. Operations on the object model: • Optimizations to address performance requirements 2. Implementation of class model components: • Realization of associations • Realization of operation contracts 3. Realizing entity objects based on selected storage strategy • Mapping the class model to a storage schema

上游究通大粤 Characteristics of Object Design Activities SHANGHAI JIAO TONG UNIVERSITY Developers perform transformations to the object model to improve its modularity and performance. Developers transform the associations of the object model into collections of object references,because programming languages do not support the concept of association. If the programming language does not support contracts,the developer needs to write code for detecting and handling contract violations. Developers often revise the interface specification to accommodate new requirements from the client. All these activities are intellectually not challenging However,they have a repetitive and mechanical flavor that makes them error prone. Software Engineering

Software Engineering Characteristics of Object Design Activities Developers perform transformations to the object model to improve its modularity and performance. Developers transform the associations of the object model into collections of object references, because programming languages do not support the concept of association. If the programming language does not support contracts, the developer needs to write code for detecting and handling contract violations. Developers often revise the interface specification to accommodate new requirements from the client. All these activities are intellectually not challenging • However, they have a repetitive and mechanical flavor that makes them error prone

上游充通大粤 SHANGHAI JIAO TONG UNIVERSITY 2.Mapping Concepts Software Engineering

Software Engineering 2. Mapping Concepts

上游充通大学 2.1 State of the Art of Model-based Software SHANGHAI JIAO TONG UNIVERSITY Engineering The Vision During object design we would like to implement a system that realizes the use cases specified during requirements elicitation and system design. The Reality Different developers usually handle contract violations differently. Undocumented parameters are often added to the API to address a requirement change. Additional attributes are usually added to the object model,but are not handled by the persistent data management system, possibly because of a miscommunication. Many improvised code changes and workarounds that eventually yield to the degradation of the system. Software Engineering

Software Engineering 2.1 State of the Art of Model-based Software Engineering The Vision • During object design we would like to implement a system that realizes the use cases specified during requirements elicitation and system design. The Reality • Different developers usually handle contract violations differently. • Undocumented parameters are often added to the API to address a requirement change. • Additional attributes are usually added to the object model, but are not handled by the persistent data management system, possibly because of a miscommunication. • Many improvised code changes and workarounds that eventually yield to the degradation of the system

上游充通大学 2.2 Model transformations SHANGHAI JIAO TONG UNIVERSITY Forward engineering Refactoring Model transformation Reverse engineering Model space Source code space Software Engineering

Software Engineering 2.2 Model transformations Source code space Forward engineering Refactoring Reverse engineering Model space Model transformation

上克通大¥2.3 Model Transformation Example SHANGHAI JIAO TONG UNIVERSITY Object design model before transformation LeagueOwner Advertiser Player +email:Address email:Address +emai1 Address Object design model after transformation: User +email:Address LeagueOwner Advertiser Player Software Engineering

Software Engineering 2.3 Model Transformation Example Object design model before transformation Object design model after transformation: Advertiser +email:Address Player +email:Address LeagueOwner +email:Address LeagueOwner Advertiser Player User +email:Address

上通大Refactoring Example:Pull Up Field SHANGHAI JIAO TONG UNIVERSITY public class User private String email; public class Player extends public class Player User private String email; //... //... 3 3 public class LeagueOwner public class LeagueOwner extends User private String eMail; //... //... 3 3 public class Advertiser public class Advertiser extends User private String //... email_address; 3 //... } Software Engineering

Software Engineering Refactoring Example: Pull Up Field public class Player { private String email; //... } public class LeagueOwner { private String eMail; //... } public class Advertiser { private String email_address; //... } public class User { private String email; } public class Player extends User { //... } public class LeagueOwner extends User { //... } public class Advertiser extends User { //... }

上游充通大学 Refactoring Example:Pull Up Constructor SHANGHAI JIAO TONG UNIVERSITY Body public class User public class User private String email; public User(String email) this.email email; public class Player extends User 3 public class Player extends User public Player(String email){ this.email email; public Player(String email){ super(ema11); publ ic class LeagueOwner extends 3 eagueOwner(String Usert publ ic class LeagueOwner extends this.email email; User t 3 mieagueOwner(String 3 super(email); public class Adyertiser 3 extendsUser{ iAdvertiser(String this.email email; publ ic class Advertiser extends User t 3 dvertiser(String super(email); Software Engineering

Software Engineering Refactoring Example: Pull Up Constructor Body public class User { private String email; } public class Player extends User { public Player(String email) { this.email = email; } } public class LeagueOwner extends User{ public LeagueOwner(String email) { this.email = email; } } public class Advertiser extendsUser{ public Advertiser(String email) { this.email = email; } } public class User { public User(String email) { this.email = email; } } public class Player extends User { public Player(String email) { super(email); } } public class LeagueOwner extends User { public LeagueOwner(String email) { super(email); } } public class Advertiser extends User { public Advertiser(String email) { super(email); } }

点击下载完整版文档(PPTX)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共64页,可试读20页,点击继续阅读 ↓↓
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有