Software Development - PowerPoint PPT Presentation

About This Presentation
Title:

Software Development

Description:

Cross-cutting of concerns. ordinary program. structure-shy. functionality. structure ... The Evils of Duplication. Tip 11: DRY Don't Repeat Yourself ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Slides: 20
Provided by: karllie
Category:

less

Transcript and Presenter's Notes

Title: Software Development


1
Software Development
  • CSU 670
  • Karl Lieberherr
  • https//lists.ccs.neu.edu/bin/listinfo/

2
Cross-cutting of concerns
better program
ordinary program
structure-shy functionality
Chapter 1
structure
Chapter 2
synchronization
Chapter 3
Woven meaning of book
3
Modularization of crosscutting concerns
Instead of writing this
4
UML Class Diagram
busStops
BusRoute
BusStopList
buses
0..
BusStop
BusList
waiting
0..
passengers
Bus
PersonList
Person
0..
5
Collaborating Classes
use connectivity in class graph to define them
succinctly using strategy graphs
from Customer to Agent
from Company to Employee
6
What's the problem? TANGLING
OOAD
collaborations
Collab-1
requirements use-cases
C1
C4
C2
C3
C5
Collab-4
Collab-2
Collab-3
C1
C4
C2
C3
Implementation
C5
classes
7
Problems with Object Decomposition
During implementation separate higher-level functi
ons are mixed together
During maintenance/evolution individual
collaborations need to be factored out of
the tangled code
8
Collaborating Classes
find all persons waiting at any bus stop on a bus
route
busStops
BusRoute
BusStopList
OO solution one method for each red class
buses
0..
BusStop
BusList
waiting
0..
passengers
Bus
PersonList
Person
0..
9
TPP section Decoupling and the Law of Demeter
  • Write shy code
  • A shy person does not interact with too many
    people.
  • A shy method does not interact with too many
    classes/objects.

10
Traversal Strategy
find all persons waiting at any bus stop on a bus
route
first try from BusRoute to Person
busStops
BusRoute
BusStopList
buses
0..
BusStop
BusList
waiting
0..
passengers
Bus
PersonList
Person
0..
11
Traversal Strategy
find all persons waiting at any bus stop on a bus
route
from BusRoute through BusStop to Person
busStops
BusRoute
BusStopList
buses
0..
BusStop
BusList
waiting
0..
passengers
Bus
PersonList
Person
0..
12
Traversal Strategy
find all persons waiting at any bus stop on a bus
route
Altern. from BusRoute bypassing Bus to Person
busStops
BusRoute
BusStopList
buses
0..
BusStop
BusList
waiting
0..
passengers
Bus
PersonList
Person
0..
13
Robustness of Strategy
find all persons waiting at any bus stop on a bus
route
from BusRoute through BusStop to Person
villages
BusRoute
BusStopList
busses
VillageList
busStops
0..
0..
BusStop
BusList
Village
waiting
0..
passengers
Bus
PersonList
Person
0..
14
TPP Tip 53 Abstractions Live Longer than Details
  • Is in the Requirements Pit section
  • Also applies to code dont overspecify!

15
Writing Adaptive Programs with Strategies
(DJpure Java)
String WPSfrom BusRoute through BusStop to
Person
class BusRoute int countPersons(ClassGraph
cg) String WPSfrom BusRoute through
BusStop to Person Integer result
(Integer) cg.traverse(this, WPS, new
Visitor() int r public void before(Person
host) r public void start() r
0 public Object getReturnValue()
return new Integer ( r) )
return result.intValue()
16
Writing Adaptive Programs with Strategies
(DJpure Java)
// Prepare the class graph ClassGraph classGraph
new ClassGraph() int r aBusRoute.countPerso
ns(classGraph)
17
TPP section The Evils of Duplication
  • Tip 11 DRY Dont Repeat Yourself
  • Imposed duplication without tool support

18
Cross-cutting in DemeterJ
generated Java program
DemeterJ program
structure-shy functionality
structure
replicated!
synchronization
19
Back to COM 1350
  • A context-free grammar is a 4-tuple (V,Sigma,R,S)
  • V Variables (or non terminals)
  • Sigma terminals
  • R rules
  • S start variable
Write a Comment
User Comments (0)
About PowerShow.com