Se202-Software Design and Architecture
Se202-Software Design and Architecture
Se202-Software Design and Architecture
ARCHITECTURE
LECTURE 1
Syllabus
Course Books:
Java Design Patterns: A Hands-On Experience with Real-World Examples. Vaskaran Sarcar
Software Architecture Design Patterns in Java. Partha Kuchana.
Design Patterns: Elements of Reusable Object-Oriented Software. Erich Gamma, Richard Helm, Ralph
Johnson, and John Vlissides.
Building
-name:String
+flatCount:int
DublexFlat NormalFlat
-withLift:boolean
-flats: Flat[] -type:int -luxury: boolean
+count:int +DublexFlat(newOwner:String,roomCo +NormalFlat(newOwner:String,roomC
+Building(name:String,flatCount:int,withLift:boolean unt:int, area:int,type:int) ount:int, area:int,luxury:boolean)
) +getType():int +getLuxury():boolean
+add(flat:Flat):void
+totalArea():int
+totalAreaRoofLuxury():int
+getName():String
+getFlats():Flat[]
+withLift():boolean
Building methods definitions:
+totalArea: Use flats array and calculate the sum of areas of flats.
-Constructor of Building:
+add: store given flat object to flats array
1) Create flat array using the flatCount value
+totalAreaRoofLuxury: check flats array 1) if flat is normal flat and it is luxury then add the area to the sum
2) assign count values as zero
2) if flat is DublexFilat and the type is 1 then add the area to the sum
Flat
-owner:String
-roomCount:int
-area:int
+Flat(newOwner:String, roomCount:int,area:int)
+getOwner():String
+getRoomCount():int
+getArea():int
Flat
-owner:String
-roomCount:int
-area:int
+Flat(newOwner:String, roomCount:int,area:int)
+getOwner():String
+getRoomCount():int
+getArea():int
DublexFlat NormalFlat
-type:int -luxury: boolean
+DublexFlat(newOwner:String, +NormalFlat(newOwner:String,roomCount:i
roomCount:int,area:int,type:int) nt,area:int,luxury:boolean)
+getType():int +getLuxury():boolean
Flat
-owner:String
-roomCount:int
-area:int
+Flat(newOwner:String, roomCount:int,area:int)
+getOwner():String
+getRoomCount():int
+getArea():int
DublexFlat NormalFlat
-type:int -luxury: boolean
+DublexFlat(newOwner:String, +NormalFlat(newOwner:String,
roomCount:int,area:int, type:int) roomCount:int, area:int,luxury:boolean)
+getType():int +getLuxury():boolean
Building
-name:String
+flatCount:int
-withLift:boolean
-flats: Flat[]
+count:int
+Building(name:String,flatCount:int,withLift:boolean
)
+add(flat:Flat):void
+totalArea():int
+totalAreaRoofLuxury():int
+getName():String
+getFlats():Flat[]
+withLift():boolean
+totalArea: Use flats array and calculate the sum of areas of flats.
+add: store given flat object to flats array
+totalAreaRoofLuxury: check flats array 1) if flat is normal flat and it is luxury
then add the area to the sum
2) if flat is DublexFilat and the type is 1 then add the area to the sum
Street
-name:String
+buildingCount:int
-buildings:ArrayList<Building>
+Street(name:String)
+add(building:Building):void
+remove(buildingName:String):void
+getName():String
+getBuildings():ArrayList<Building>