Se202-Software Design and Architecture

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

SE202-SOFTWARE DESIGN AND

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.

 Grading Policy (Tentative):


 Midterm % 40
 Final % 60
Street
Street methods definitions:
-name:String +add: add building object to buildings ArrayList
+buildingCount:int Flat
+remove: find the building in the buildings ArrayList
-buildings:ArrayList<Building> (name of the building is given) and remove it from the list. -owner:String
*For string comparison use equalsIgnoreCase() method. -roomCount:int
+Street(name:String) public boolean equalsIgnoreCase(String anotherString)
+add(building:Building):void -area:int
Ex: retVal = Str1.equalsIgnoreCase( Str2 );
+remove(buildingName:String):void +Flat(newOwner:String, roomCount:int,area:int)
+getName():String +getOwner():String
+getBuildings():ArrayList<Building> +getRoomCount():int
+getArea():int

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>

equalsIgnoreCase() in Java. The equalsIgnoreCase() method compares two strings irrespective of


the case (lower or upper) of the string. This method returns true if the argument is not null and it
represents an equivalent String ignoring case, else false.
public boolean equalsIgnoreCase(String anotherString)
Ex: retVal = Str1.equalsIgnoreCase( Str2 );

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy