1 Basic Laws of Object Modeling Rohit Gheyi Tiago Massoni Paulo Borba Software Productivity Group Informatics Center – UFPE.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Using Matrices in Real Life
Advanced Piloting Cruise Plot.
Copyright © 2002 Pearson Education, Inc. Slide 1.
Chapter 6 Structures and Classes. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 6-2 Learning Objectives Structures Structure types Structures.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2003 Pearson Education, Inc. Slide 1.
Chapter 1 The Study of Body Function Image PowerPoint
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
We need a common denominator to add these fractions.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
Multiplying binomials You will have 20 seconds to answer each of the following multiplication problems. If you get hung up, go to the next problem when.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
2010 fotografiert von Jürgen Roßberg © Fr 1 Sa 2 So 3 Mo 4 Di 5 Mi 6 Do 7 Fr 8 Sa 9 So 10 Mo 11 Di 12 Mi 13 Do 14 Fr 15 Sa 16 So 17 Mo 18 Di 19.
ZMQS ZMQS
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
ABC Technology Project
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
VOORBLAD.
15. Oktober Oktober Oktober 2012.
Quadratic Inequalities
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
1 public class Newton { public static double sqrt(double c) { double epsilon = 1E-15; if (c < 0) return Double.NaN; double t = c; while (Math.abs(t - c/t)
BIOLOGY AUGUST 2013 OPENING ASSIGNMENTS. AUGUST 7, 2013  Question goes here!
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Squares and Square Root WALK. Solve each problem REVIEW:
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Slippery Slope
H to shape fully developed personality to shape fully developed personality for successful application in life for successful.
Januar MDMDFSSMDMDFSSS
Week 1.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Intracellular Compartments and Transport
PSSA Preparation.
Immunobiology: The Immune System in Health & Disease Sixth Edition
Essential Cell Biology
1 PART 1 ILLUSTRATION OF DOCUMENTS  Brief introduction to the documents contained in the envelope  Detailed clarification of the documents content.
1 Chapter 13 Nuclear Magnetic Resonance Spectroscopy.
Immunobiology: The Immune System in Health & Disease Sixth Edition
CpSc 3220 Designing a Database
Traktor- og motorlære Kapitel 1 1 Kopiering forbudt.
1 A UML Class Diagram Analyzer Tiago Massoni Rohit Gheyi Paulo Borba Software Productivity Group Informatics Center – UFPE October 2004.
Presentation transcript:

1 Basic Laws of Object Modeling Rohit Gheyi Tiago Massoni Paulo Borba Software Productivity Group Informatics Center – UFPE

2 Introduction Semantics-preserving model transformations are usually proposed in an ad hoc way Simple mistakes may lead to incorrect transformations introduce inconsistencies

3 Introduction Modeling Laws each law defines two transformations have not been sufficiently studied yet might bring similar benefits of programming laws Reliability Productivity Identify, formalize and study modeling laws Focus: modeling laws for Alloy earlier stages of the software development process

4 Alloy sig Bank { accounts: set Account } sig Account {} sig ChAcc extends Account {} sig SavAcc extends Account {} fact AccPartition { Account = ChAcc + SavAcc }

5 Basic Laws We propose basic laws defining properties about: signatures facts relations Predicate calculus and relational operator properties are used here

6 Example: Introduce Relation =,v

7 Introduce Relation Law (Law 2) () if r belongs to then v contains the rexp item; () The family of S in ps does not declare r; () r does not appear in ps and forms. ps sig S { rs } fact F { forms } ps sig S { rs, r : set T } fact F { forms r = exp } =,v

8 Equivalence Notion =,v = {Bank, accounts, Account} v = {(accounts col.elems)} Alphabet View

9 Example: Pull Up Relation (Law 3) no (Account-ChAcc).chOwner =,v

10 Introduce Formula Law (Law 4) provided () The formula f can be deduced from the formulas in ps and forms. ps fact F { forms } ps fact F { forms f } =,v

11 Bank System Atomization Law 2 ()Law 4 ()Law 3 () Law 4 () Law 2 ()

12 Components: Specification Matching public class DBHandler { private static OleDbConnection connection; public static OleDbConnection Connection { get { if (connection == null) { string dataSource = "BancoCS.mdb"; string strConexao = "Provider= Microsoft.Jet.OLEDB.4.0; " + "Data Source=" + dataSource; connection = new OleDbConnection(strConexao); } return connection; } public static void StartTransaction() { Connection.Open(); transaction = Connection.BeginTransaction(); } public class DBHandler { private static OleDbConnection connection; public static void StartTransaction() { transaction = Connection.BeginTransaction(); } public static void main(String []args) { System.out.rintln(); connection = new OleDbConnection(strConexao); } public static OleDbConnection Connection { get { if (connection == null) { string dataSource = "BancoCS.mdb"; "Data Source=" + dataSource; } return connection; } M1 =,v... M2Mn Component Syntactic conditions

13 Conclusions Axiomatic semantics Optimize analysis Substitute Components Derive refactorings

14 Future Work Propose more basic laws and refactorings Show that our set of laws are complete propose a normal form for Alloy PVS (Prototype Verification System) Model Refactoring X Code Refactoring

15 Basic Laws of Object Modeling Rohit Gheyi Tiago Massoni Paulo Borba Software Productivity Group Informatics Center – UFPE

16 Introduce Empty Signature Law provided () ps does not declare any paragraph named S; S is not in; () S does not appear in ps; if S is in then v contains an item for S. ps sig S {} Set of paragraphs =,v

17 Pull Up Relation Law ps sig T { rs } sig S extends T { rs, r : set U } fact F { forms } ps sig T { rs, r : set U } sig S extends T { rs } fact F { forms all t: T-S | no t.r } =,v

18 Move Formula Law ps fact F { forms f } fact G { forms } ps fact F { forms } fact G { forms f } =,v

19 Split Relation Law ps sig S { rs, r : set T } fact F { forms } ps sig S { rs, r : set T, u : set U } fact F { forms && r = u.t } sig U { t : set T } () if r belongs to then v contains the ru.t item;... () ps does not declare any paragraph named U; the family of S does not declare any relation named u in ps; () U, t and u do not appear in ps, rs and forms. =,v

20 Introduce a Generalization Law ps sig S { rs } sig T { rs } fact F { forms } ps sig U {} sig S extends U { rs } sig T extends U { rs } fact F { forms U=S+T } () if U belongs to then v contains the U(S+T) item; () ps does not declare any paragraph named U and the family of S and T does not declare any relation with the same name in ps () U, S and T do not appear in ps, rs, rs and forms. =,v

21 Change Relation Qualifier Type: from set to one Law ps sig S { rs, r : set T } fact F { forms all s: S | one s.r } ps sig S { rs, r : one T } fact F { forms } =,v

22 Example: Split Relation accounts = col.elements =,v = {Bank, accounts, Account} v = {(accounts col.elements)}

23 Example: Introduce a Generalization = {ChAcc, SavAcc} v = {(Account ChAcc+SavAcc )}

24 Introduce a Generalization Refactoring Architects x Designers All basic laws are very simple to apply since their pre-conditions are simple syntactic conditions

25 Extract Interface Refactoring () if C belongs to then v contains the CB item; () ps does not declare any paragraph named C; () C does not appear in ps, rs, rs and forms.

26 Inserting a Collection Refactoring =,v

27 Moving a Relation Refactoring =,v

28 Extending a Signature Constraint S in T Formula deduced (S in T) => (#S <= #T) #S = 5 && #T = 3 =,v

29 Inserting a Relation Constraint all s: S | one s.r Formula deduced (#S != 0) => (#T > 0) #S != 0 && #T = 0 =,v

30 Inserting a Relation in a Subsignature Suppose s be an element that does not belong to T and relates with an element u of U in r After including t=r, we have (((s->u) in r) && (t = r)) => ((s->u) in t) some s:S | s !in Tt=r =,v