Gnie logiciel Software Engineering C' Petitpierre - PowerPoint PPT Presentation

1 / 33
About This Presentation
Title:

Gnie logiciel Software Engineering C' Petitpierre

Description:

G nie logiciel. Software Engineering. C. Petitpierre. Development Process ... Superficial analysis, design, implementation and test of the whole application, ... – PowerPoint PPT presentation

Number of Views:70
Avg rating:3.0/5.0
Slides: 34
Provided by: Petitp5
Category:

less

Transcript and Presenter's Notes

Title: Gnie logiciel Software Engineering C' Petitpierre


1
Génie logicielSoftware EngineeringC.
Petitpierre
2
Development Process
3
Waterfall Development Process
Analysis
Design
Implementation
Testing
?
Maintenance
Civil engineering One first draws plans and
only then are they realized ! Why wouldnt it
work with software ?
4
Iterative Process (spiral)
Test
Implementation
Maintenance
Development
Analysis
Design
Superficial analysis, design, implementation and
test of the whole application, then better
analysis, design, implementation and test, and
improvement at each revolution ? or ? Thorough
analysis, design, implementation and test of a
part, and then analysis, design, implementation
and test of a new part at each revolution ?
5
Agile Development Process
Most important characteristics No long term
planning. Deliver working software frequently
(from a couple of weeks to a couple of months,
with a preference to the shorter timescale).
6
XProgramming
  • Planning
  • Designing
  • Coding
  • Testing

of a slice
2-6 weeks
7
UMLUnified Modeling Language(OMG object
management group)
http//www.uml.org/ http//www.omg.org/
8
Class diagram inheritance
9
UML note(Omondo on Eclipse)
10
Class diagram aggregation
Bill - numberOfItems  int addItem(itemItem)
- getFirstItem()  Item getNextItem()  Item
BillItem ProductNumber  int
NumberOfPieces  int UnitPrice  int
1
0..
Customer name  String
11
Sequence diagram
Main
Object X
Object B
new ( )
start ( )
run ( )
xMeth ( )
12
Activity diagram an example
registration
Fork Two threads Join
quit
find
close
log
register
13
ltlt Stereotypes gtgt
Customer name  String
ltlt CMP EJB gtgt Bill - numberOfItems  int
ltlt hasBills gtgt
14
List of elements
15
List of elements
function Head()      this.first  null    
this.last  null     this.current  null
function init()      var lst  new Head()    
lst.addAlpha(new Name("Max"))    
lst.addAlpha(new Name("Henri"))    
lst.addAlpha(new Name("Moritz"))    
lst.addAlpha(new Name("Judith"))     var t    
lst.current  null     while((t  lst.next()) ! 
null)          document.write(t.obj.name  "ltbrgt
")    
function Handle( o )      this.next  null    
this.obj  ofunction Name(name)     
this.name  name
16
List of elements
Head.prototype.next  function()     
if (this.current  null)         
this.current  this.first      else         
this.current  this.current.next         
return this.current
Head.prototype.add  function(o)     
if (this.firstnull)         
this.first  new Handle(o)        
this.last  this.first      else         
this.last.next  new Handle(o)        
this.last  this.last.next    
17
Insertion in alpha order
Head.prototype.addAlpha  function(o)     
var t, tmp     var tmp  new Handle(o)    
if (this.firstnull)         
this.add(o)         return         
this.current  null     if (o.name lt this.first.o
bj.name)          tmp.next  this.first        
this.first  tmp      else         
while( (t  this.next()).next ! null)          
    if (o.name lt t.next.obj.name)               
   tmp.next  t.next                
t.next  tmp                 return            
                  t.next  tmp        
this.last  tmp    
18
Insertion in alpha order
Head.prototype.addAlpha  function(o)     
var t, tmp     var tmp  new Handle(o) .
. .          while( (t  this.next()).next ! nul
l)              if (o.name lt t.next.obj.name) 
                 tmp.next  t.next               
  t.next  tmp                
return                              
t.next  tmp         this.last  tmp    
tmp
o
t
19
Design Patterns
http//en.wikipedia.org/wiki/Design_Patterns http
//en.wikipedia.org/wiki/Design_pattern_(computer_
science) See also anti-patterns in Wikipedia and
http//ltiwww.epfl.ch/petitp/GenieLogiciel/
PointCounterPoint.pdf
20
Design Patterns
Christopher Alexander is an architect noted for
his theories about design. He produced and
validated a pattern language designed to empower
any human being to design and build at any scale.
The concept of design patterns has been reused
in IT by E.??Gamma, R Helm, R. Johnson and J.
Vlissides also known as the Gang of Four or GoF.
They have sold 500.000 copies of their
book. Abstract factory, Adapter, Composite,
Decorator, Factory methods, Observer, Strategy,
Template method E. Gamma is currently heading
the Eclipse project Other books about patterns
have been written by other authors
21
The GoF patterns
Design Patterns Elements of Reusable
Object-Oriented Software, E. Gamma (mostly at
the class level, not the application level)
22
Singleton
Class2
Class1
Class3
Singleton
Only one singleton is instantiated One does not
know the order in which the Classi are
instantiated All Classi are not always present,
they have no references to each other and there
may be other such classes later Who does create
the Singleton ?
23
Equivalent in Javascript
function Singleton()     this.attr  13Single
ton.instance  null // Will contain the one and
only instance of the class                       
                  // Remember, a function's
definition is stored in an objectSingleton.getIns
tance  function()     if (Singleton.instance 
 null)         Singleton.instance  new Singleto
n()        return Singleton.instanceSingle
ton.prototype.alerte  function()     alert(this
.attr)function init()                  //
Creation and call of the singleton    var single 
 Singleton.getInstance()    single.alerte()
// But in
Javascript, it is easy to declare a single global
object
24
Composite tree structure(one must be able to
walk through and add/remove groups or leaves in
the same way)
super group
Model of a diagram for a graphical application
group
square
line
circle
square
25
Composite
26
Composite object diagram
super group tableau
group tableau
square
line
circle
square
Chaque objet extends Component pour que tous les
noeuds soient semblables
27
Composite object diagram
Component
Component
Component
Component
group
square
line
Component
Component
circle
square
Chaque objet extends GraphicComponent pour que
chaque noeud soit semblable
28
Composite in Javascript
 function GraphicComponent (name)        this.na
me  name  GraphicComponent.prototype.print  f
unction ()        console.log(" "this.name) 
Base element
 CompositeGraphic.extend(GraphicComponent)  functi
on CompositeGraphic  ()       this.mChildGraphic
s  new Array()   CompositeGraphic.prototype.
print  function ()       for (var i0 iltthis.m
ChildGraphics.length i)           this.mChild
Graphicsi.print()        CompositeGraphic.p
rototype.add  function (child)       this.mChil
dGraphics.push(child)
Aggregate element
29
Node examples
Line.extend(GraphicComponent) function  Line(name,
 x1, y1, x2, y2)       Line.upper(this, name)  
    this.x1  x1      this.y1  y1      this.x2 
 x2      this.y2  y2 Line.prototype.print  
function ()      Line.upperClass.print.call(thi
s)      ctx.moveTo(this.x1, this.y1)      ctx.li
neTo(this.x2, this.y2)
Node element Canvas Rectangle
Rect.extend(GraphicComponent) function  Rect(name,
 x1, y1, w, h)     Rect.upper(this, name)    th
is.x1  x1    this.y1  y1    this.w  w    thi
s.h  h Rect.prototype.print  function ()   
  Rect.upperClass.print.call(this)    ctx.fillSty
le"rgb(255,0,0)"    ctx.fillRect(this.x1, this.
y1, this.w, this.h)
Node element Canvas Line
30
Utilisation des objets précédents
        var g1  new CompositeGraphic()
function init()             var o1  new Line("l
1", 10,10,100,100)            g1.add(o1)        
    g1.add(new Line("l2", 10, 100, 100, 100))    
        g1.add(new Rect("r1", 10,10,55,50))      
      g2  new CompositeGraphic()            g1.a
dd(g2)            g2.add(new Rect("r2", 100,10,55
,50))            g2.add(new Rect("r2", 200,100,55
,50))            g1.print ()        
31
Observer
call
Each time the subject is called, it calls a
method in all the observers. Thus at the end of
each method called in the subject, there is a
call to the list of observers. The observer are
registered, sometimes by themselves The observers
must of course have a common interface. They are
also called listeners!
call
call
Subject
Observer
Observer
32
Observer
Subject void notify() for (observer o
pool) o.update()
Event
33
Observer
  • Observer
  • update()
  • it often register itself in the subject
  • Subject
  • notify()
  • addObserver()
  • removeObserver()
Write a Comment
User Comments (0)
About PowerShow.com