Slide 1

Slide 1 text

jgs SER 516 Software Agility Lecture 21: Dependency Principles III Dr. Javier Gonzalez-Sanchez [email protected] javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment

Slide 2

Slide 2 text

jgs Previously… Structural Quality

Slide 3

Slide 3 text

jgs 516 00010000 • Instability = Cout (Cin + Cout) Stable Abstraction Principle IC = 1.0, A= ? IX= 0.5, A= ? IA = 0.0, A= ?

Slide 4

Slide 4 text

jgs 516 00010000 Stable Abstraction Principle More stable a package is, the more abstract it should be.

Slide 5

Slide 5 text

jgs 516 00010000 Stable Abstraction Principle Abstract concrete Stable Hard to Change Only incoming dependencies Unstable Changeable Only outgoing dependencies

Slide 6

Slide 6 text

jgs 516 00010000 Question

Slide 7

Slide 7 text

jgs 516 00010000 Question A) B)

Slide 8

Slide 8 text

jgs Stable Dependency Principle

Slide 9

Slide 9 text

jgs 516 00010000 Stable Dependency Principle § Every dependency between modules should terminate on a module whose Instability metric is less than or equal to the depending module's Instability metric. § Every dependency between modules should terminate on a module whose Abstractness metric is greater than or equal to the depending module's Abstractness metric.

Slide 10

Slide 10 text

jgs 516 00010000 Question 3 (again) A) B)

Slide 11

Slide 11 text

jgs 516 00010000 SAP + SDP § Distance: how far a package is away from the Main Sequence § D = A + I – 1 § Values -1 to 1 § Absolute Distance |D|

Slide 12

Slide 12 text

jgs 516 00010000 Question project3.common.model project3.client.UI project3.server.controller

Slide 13

Slide 13 text

jgs 516 00010000 Question

Slide 14

Slide 14 text

jgs 516 00010000 Question public class Foo { Bar b= new Bar(new Car()); public Foo (Car c) { c.doIt(b); } public void m (Delta d) { d.action(b); } } public class System { public ... main ( ...) { Foo f = new Foo(); //... } }

Slide 15

Slide 15 text

jgs 516 00010000 Question public class Foo { Bar b= new Bar(new Car()); public Foo (Car c) { c.doIt(b); } public void m (Delta d) { d.action(b); } } public class System { public ... main ( ...) { Foo f = new Foo(); //... } } • Tangled: • ISystem = • IFoo = • IBar • Afoo • Any candidate for “painful” zone:

Slide 16

Slide 16 text

jgs 516 00010000 Question A:0 Ca:1 Ce:4 I:4/5=0.8 D:-0.2 A:0 Ca:2 Ce:3 I:3/5=0.6 D:-0.4 A:0 Ca:1 Ce:3 I:3/4=0.75 D:-0.25

Slide 17

Slide 17 text

jgs 516 00010000 Example

Slide 18

Slide 18 text

jgs 516 00010000 Reference § Agile Software Development: Principles, Patterns, and Practices. Robert C. Martin. Prentice Hall. 2006. Chapter 30.

Slide 19

Slide 19 text

jgs SER 516 Software Agility Javier Gonzalez-Sanchez [email protected] Spring 2021 Disclaimer. These slides can only be used as study material for the class SER516 at ASU. They cannot be distributed or used for another purpose.