component based software engineering
DESCRIPTION
Component based software engineeringTRANSCRIPT
By Nadia Nahar
11/18/2014 1
• Component Level Design
– Library Circulation System
• Designing Conventional Component
11/18/2014 2
11/18/2014 3
11/18/2014 4
User
user_typeuser_namepassworduser_statuse-mail
authenticate()search()renew()booking()
Administrator
user_namepassworde-mail
configure()authenticate()
Librarian
user_namepassworde-mail
issue()retrieve()add()edit()delete()
Report
report_nointended_userdatereport_type
notifyUser()blockUser()
Item
item_typecall_numberitem_statusassigned_user
issueItem()retrieveItem()itemAvailability()
Fine
fine_typefine_amountassigned_userassigned_itemfine_rateborrowing_duration
generateReport()updateUser()calculateFineAmount()
11/18/2014 5
11/18/2014 6
DAO
insert()update()delete()select()
GUI
menu_itemsthemeelements
update()link()
DB Connect
connectionStringdatabaseNamedatabaseUserPassworddatabaseType
connect()
11/18/2014 7
11/18/2014 8
issue
retreive
Librarian
user_namepassworde-mail
selectUser()checkUserStatus()selectItem()checkItemStatus()show()updateItem()updateUser()selectUser()checkFine()selectItem() updateItem()updateUser()add()edit()delete()
DAOIssue
selectUser()checkUserStatus()selectItem()checkItemStatus()show()updateItem()updateUser()
DAORetreive
selectUser()checkFine()selectItem() updateItem()updateUser()
Librarian
user_namepassworde-mail
issue()retrieve()add()edit()delete()
11/18/2014 9
calculateFine
generateReport
Fine
fine_typegeneral_finespecial_finedestruction_fine
fine_amountassigned_user
GeneralSpecial
assigned_itemAvailableUnavailable
fine_rateborrowing_durationgetDuration()getItemType()getRate()calculate()getNotification()calculateFineAmount()getUser()acquireEmailAddress()sendNotification()updateUser()
DAOcalculateFine
getDuration()getItemType()getRate()calculate()
DAOgenerateReport
getNotification()calculateFineAmount()getUser()acquireEmailAddress()sendNotification()updateUser()
Fine
fine_typefine_amountassigned_userassigned_itemfine_rateborrowing_duration
calculateFineAmount()generateReport()updateUser()
11/18/2014 10
11/18/2014 11
1.userDetails := selectUser(userName)2.userStatus := checkUserStatus (user)
3.itemDetails := selectItem(itemName)4.itemStatus := checkItemStatus (item)
11/18/2014 12
1.userDetails := selectUser(userName)
3.itemDetails := selectItem(itemName)
2.Fine := checkFine(User)
11/18/2014 13
1.duration := getDuration(user,item)
3.fineRate := getRate(itemType)
2.itemType := getItemType(item)
11/18/2014 14
11/18/2014 15
issue
retreive
selectItem
<<interface>>issue
PassItemtoIssue()
selectUser
11/18/2014 16
issue
retreive
selectItem
<<interface>>retrieve
PassItemtoRetrieve()
selectUser
checkFine
11/18/2014 17
calculateFine
generateReport
getDuration
<<interface>>calculateFine
PassUserItemtoCalculateFine()
getFineRate
getItemType
11/18/2014 18
11/18/2014 19
Attribute Name Class Data Type/Data Structure
user_type user enum
user_name user,administrator,librarian string
password user,administrator,librarian string
user_status user enum
e-mail user,administrator,librarian string
report_no report int
intended_user report int
date report date
report_type report enum
11/18/2014 20
11/18/2014 21
11/18/2014 22
Input Item
Validate Input
retrieve
Arrange Alphabetically
Arrange by Arrival Date
Arrange by Category
show
arrangeType=Name
arrangeType=ArrivalDate
arrangeType=Category
11/18/2014 23
Select User
Select Item
Check Item Availability
Update Item,User
available
Not available
Check User Availability
active
blocked
11/18/2014 24
Select User
Select Item
Update User
Check Fine
no
yes Generate Report
Update Item
11/18/2014 25
• Date Source
– User Database
– Item Database
• Required Class
– DB Connect
– DAO
11/18/2014 26
DAO
insert()update()delete()select()
DB Connect
connectionStringdatabaseNamedatabaseUserPassworddatabaseType
connect()
11/18/2014 27
11/18/2014 28
Librarian
11/18/2014 29
Item
11/18/2014 30
Report
11/18/2014 31
11/18/2014 32
Central Processor
Database Server
Proxy Web Server
Remote PC
Control Panel Unit
Library PC http
Secure Communication
11/18/2014 33
• Graphical design notation
• Tabular design notation
• Program design language
11/18/2014 34
11/18/2014 35
Select User
Select Item
Check Item Availability
Update Item,User
available
Not available
Check User Availability
active
blocked
Select User
Select Item
Update User
Check Fine
no
yes
Generate Report
Update Item
Get Selection
issue retrieve
Conditions 1 2 3 4
User Status F T F T
Item Status F F T T
Actions
Issue Item
Don’t Issue
11/18/2014 36
Rules
Conditions 1 2
Check Fine F T
Actions
Retrieve Item
Fine Report
Rules
11/18/2014 37
Component Librarian:
The intent of this component is to manage the circulation of items of the library and also update item data.
Initialize all system ports and reset all hardware
select user(username)
contact with user class and get the details of an user specified by username
check user_status(user)
if user.status=“blocked”
return “user is blocked”
elseif user.status=“active”
return “user is active”
……………………………………………………………………
……………………………………………………………………………
11/18/2014 38