Professional Documents
Culture Documents
CS701a File
CS701a File
SoftwareArchitectures
(CS-701)
For
FinalYearStudentsCSE
Dept:ComputerScience&Engineering
1
LISTOFPROGRAMS
2
Program-01
ATMAPPLICATIONSYSTEM
1. ABSTRACT
2. FEATURES
3. ADVANTAGESANDDISADVANTAGES
4. REQUIREMENTS
4.1 FUNCTIONALREQUIREMENTS
4.2 NON-FUNCTIONALREQUIREMENTS
4.3 TECHNICALREQUIREMENTS
5. DIAGRAMS
5.1 USECASEDIAGRAM
5.2 ACTIVITYDIAGRAM
5.3 SEQUENCEDIAGRAM
5.4 COLLABORATIONDIAGRAM
5.5 COMPONENTDIAGRAM
5.6 DEPLOYMENT DIAGRAM
5.7 STATECHARTDIAGRAM
3
ABSTRACT
Anautomatedtellermachine(ATM)orcashmachineisanelectronictelecommunica
tionsdevicethatenablescustomersoffinancialinstitutionstoperform financial
transactions, such as cash withdrawals, deposits, funds
transfers,oraccountinformationinquiries,atanytimeandwithouttheneedfor
directinteractionwithbankstaff.
Using an ATM, customers can access their bank deposit or credit accounts in
orderto make a variety of financial transactions, most notably cash withdrawals
andbalance checking, as well as transferring credit to and from mobile phones.
ATMscan also be used to withdraw cash in a foreign country. If the currency
beingwithdrawn from the ATM is different from that in which the bank account
isdenominated, the money will be converted at the financial institution's
exchangerate.
The automated teller machine consists of mainly two input devices and four
outputdevicesthatare:
InputDevices
Cardreader
Keypad
OutputDevices
Speaker
DisplayScreen
ReceiptPrinter
CashDepositor
4
FEATURES
Transferfundsbetweenlinkedbank accounts.
Receiveaccountbalance.
Printsrecenttransactionslist.
Changeyour pin.
Deposityourcash.
Prepaidmobilerecharge.
Billpayments.
Cashwithdrawal.
AdvantagesofATMApplication
TheATMprovides24hoursservice
TheATMprovidesprivacyinbankingcommunications
TheATMsreducetheworkloadbanksstaff
TheATMmaygivecustomernewcurrencynotes
TheATMsareconvenientforbankscustomers
TheATMisverybeneficialfortravelers
TheATMprovides serviceswithoutanyerror
DisadvantagesofATMApplication
Fraud.CriminalscanfitskimmingdevicesandsmallcamerastoATMs....
Fees. Banks and machineowners draw a huge source of
revenuefromATMfees....
TheftRisk.Ifyougotoabank,
you'relikelywalkingintoasecuredareawatchedbymultiplecamerasoralife
guard....
CardRetention.ATMsgive,buttheycanalsotake.
5
stolen,maybemisused. There are numberofsuchreportedincidencesnowaday.
6
REQUIREMENTS:
Functionalrequirements
1. SecureregistrationandprofilemanagementfacilitiesforCustomers
2. SecuredmechanismforPayment
3. Account management
Non-functionalrequirements
1. Performance
2. Quality
3. Secureaccessofconfidentialdata(user’sdetails).
4. 24X7availability
Technicalrequirements
1. Browser
2. Server
3. MySQL
4. PHP
5. Javascript
6. HTML&CSS
7
ATMScenarioUseCaseDiagram:
Ausecasediagramatitssimplestisarepresentationofa user'sinteractionwiththesystem
that shows the relationship between the user and the different use cases
inwhichtheuserisinvolved.
ATMScenarioActivityDiagram:
Activity diagrams are probably the most important UML diagrams for doing business
processmodeling.Insoftwaredevelopment,itisgenerallyusedtodescribetheflowofdifferentactivities
and actions. These can be both sequential and in parallel. They describe the objectsused,
consumed or produced by an activity and the relationship between the different
activities.Alltheaboveis essentialinbusiness processmodeling.
8
ATMScenarioSequenceDiagram:
9
ATMScenarioCollaborationDiagram:
Acollaborationisadescriptionofacollectionofobjectsthatinteracttoimplement some
behavior within a context. It describes a society of cooperatingobjectsassembled
tocarryoutsomepurpose.
ATMScenarioComponentDiagram:
ComponentUMLdiagramscanhelpbreakdownthesystemintosmallercomponents.
Sometimes it is hard to depict the architecture of a system because
itmightencompassseveraldepartmentsoritmightemploydifferenttechnologies.
10
ATMScenarioDeploymentDiagram:
Deployment diagrams are a set of nodes and their relationships. These nodes
arephysicalentitieswherethecomponentsaredeployed.Thedeploymentviewrepres
entsthearrangementofruntimecomponentinstancesonnodeinstances.
ATMScenarioStateChartDiagram:
State chart diagrams, are used to describe the different states of acomponentwithin
a system. It takes the name state machine because the diagram is
essentiallyamachine that describes the several states of an object and how it
changes basedoninternaland externalevents.
11
Program-02
WEATHERMAPPINGSYSTEM
1. ABSTRACT
2. FEATURES
3. ADVANTAGESANDDISADVANTAGES
4. REQUIREMENTS
4.1 FUNCTIONALREQUIREMENTS
4.2 NON-FUNCTIONALREQUIREMENTS
4.3 TECHNICALREQUIREMENTS
5. DIAGRAMS
5.1 USECASEDIAGRAM
5.2 ACTIVITYDIAGRAM
5.3 SEQUENCEDIAGRAM
5.4 SEQUENCEDIAGRAMFORLOGIN
5.5 SEQUENCEDIAGRAMFORWEATHERSTATIONUSER
5.6 OBJECTORIENTEDDIAGRAMOFTHESYSTEM
12
ABSTRACT
A weather map, also known as synoptic weather chart, displays
variousmeteorological features across a particular area at a particular point in time
and hasvarious symbols which all have specific meanings. Such maps have been in
usesince themid-19th century and areusedfor research
andweatherforecastingpurposes.
Typically, the weather data collection system establishes a modem link with
theweatherstationandrequeststransmissionofthedata.
The data sent to the weather data collection system are the maximum,
minimumandaveragegroundtemperatures,themaximum,minimumandaverageairpre
ssures,themaximum,minimum,and average windspeeds.
Weather stations are usually asked to report once per hour but this frequency
maydifferfromonestationtoanother andbemodifiedinthefuture.
FEATURES
WMS provides a range of map processing operations (e.g., two-dimensional
andthree-
dimensionalmappings),weatherdatastorageforthemaps,andnetworkaccesstothemaps
forremoteviewers.Itskeymarketingfeaturesarethefollowing:
Auser-friendlyoperatorenvironment
Thethroughputofweatherdataacquisitionis50%higherthanpreviousprodu
ct
Mapsdisplaycanbeasfastasthemaximumhardwarespeed
Isdesignedforeasyupgradetonewplatforms 12
Hasopenplatformconnectivity
Advantages
HighQualityofData
Reliableweatherforecasts
Moreaccurateresults
Research
LocatePrecipitation
WeatherSurveillance
FloodForecasting
HailDetection
Disadvantages
CannotDetectFog
CannotDetectWind Independently
NotEntirelyReliable
ReliesonIntense Datasets
TheEstimates canbewrong
Weatherchangesallthetime
RadarTechnologykeepsgrowing
REQUIREMENTS:
Functionalrequirements
1. Secureregistrationandprofilemanagementfacilities
2. Securedmechanism
3. WeatherManagement
Non-functionalrequirements
1. Performance
2. Quality
3. Secureaccessofconfidentialdata(user’sdetails).
4. 24X7availability
Technicalrequirements
1. Browser
2. Server
3. MySQL
6.HTML&CSS
4.
5. PHP
Javascript 13
6.HTML&CSS
Use-CaseDiagramofTheSystem
ActivityDiagramoftheSystem
14
SequenceDiagramofThisSystem
SequenceDiagramforLogin
15
SequenceDiagramforWeatherStationUser
ObjectOrientedDesignof theSystem
16
Program-03
LIBRARYMANAGEMENTSYSTEM
1. ABSTRACT
2. ADVANTAGESANDDISADVANTAGES
3. FEATURES
4. REQUIREMENTS
4.1 FUNCTIONALREQUIREMENTS
4.3NON-FUNCTIONALREQUIREMENTS
4.3TECHNICALREQUIREMENTS5.
DIAGRAMS
5.1 CLASSDIAGRAM
5.2 USECASEDIAGRAM
5.3 ACTIVITYDIAGRAM
5.4 STATECHARTDIAGRAM
5.5 SEQUENCEDIAGRAM
5.6 COLLABORATIONDIAGRAM
5.7 DEPLOYMENTDIAGRAM
17
ABSTRACT
ALibraryManagementSystemisasoftwarebuilttohandletheprimaryhousekeeping
functions of a library. Libraries rely on library management systems
tomanageassetcollectionsaswellasrelationshipswiththeirmembers.Librarymanagement
systems help libraries keep track of the books and their checkouts,
aswellasmembers’subscriptionsand profiles.
Library management systems also involve maintaining the database for entering
newbooks and recording books that have been borrowed with their respective due
dates. Itprovidesfamiliarandattractiveinterfacewithinsertingandreportingcapabilities.
Advantages
1. Simple&Easy toUse
TheLibraryManagementSoftwareissimple,user-
friendly,andcanbeeasilyintegratedwithyourexistingsystem.Thelibrarymanagementsyst
embenefitsprovide online and offline storage, automated backups, and easy upgrades
to simplifyand enhancethelearningprocess.
2. IncreasedLibraryEngagement
3.EfficientCloudDataManagement
Automate, simplify and deploy library database seamlessly to make it easy for
yourinstitutiontobenefitfromsecurecloudservices.Improveefficiencywiththeautomatio
nofvariouslibrarytasksincludingacquisition,cataloging,serialsmanagement,circulation
andreference.
18
4. HighlySecure,Scalable&Reliable
5. MobileAccess
The library management system provides mobile access to search the library
catalog,schedules, books and resources from anywhere, at any given time via
smartphonesand tablets.
7. Error-free
8. Innovation
Students can search, write articles, upload photos and videos, manage email,
sendmessages, but also help them to keep up with the librarian and other students via
chat,discussion forums,andsocialmedia.
9. Cost-effective
Embracingsophisticatedtechnologiesiscost-effectiveandaviablechoiceforeducation
institutions. Using cloud,mobile and digital libraries eliminatespaper-
basedprocessesandmaintenanceoverheads,improvesproductivity,reducesoperationcost
sand savestime.
Disadvantages
1. Thedatastoredispronetocyberhacks.Optingforareliableonlinesystemelimina
testherisk
2. CostlyandExpensive
3. Complicatedtooperate
4. OnlineSystemsrequirehigh-speedinternetconnectivity
5. Riskofcomputervirus
6. Theautomationfeatureisnotavailableinoffline/open-
sourcesystemsthus,requiresmanualactionto performoperations
19
Features
Amodernintegratedlibrarymanagementsystem(LMS).
CanbescalabletoWindows,LinuxandMacOSplatform.
Printyourownbarcodes.
Full catalog, circulation and acquisitions system for library stock
management.
WebbasedOPAC(OnlinePublicAccessCatalog)system.
Simple,clearsearchinterfaceforallusers.
REQUIREMENTS:
FunctionalRequirements
1. Anewuserwhichisnotregisteredinthesystem.Registrationformmustbeavailab
le.Detailsmustbecorrect.
2. MembermustberegisteredagainstuniqueID
3. Books mustbeavailable
4. Wemusthavelibrarianaccountwhichmanagesthewhole system.
Non-functionalrequirements
1. Performance
2. Quality
3. Secureaccessofconfidentialdata(user’sdetails).
4. 24X7availability
Technicalrequirements
1. Browser
2. Server
3. MySQL
4. PHP
5. Javascript
6. HTML&CSS
20
DiagramClass
Diagram
21
ObjectDiagram
22
USECASEDIAGRAM
23
ACTIVITYDIAGRAM
24
StateChartDiagram
25
SequenceDiagram
COLLABORATIONDIAGRAM
Acollaborationisadescriptionofacollectionofobjectsthatinteracttoimplement
some behavior within a context. It describes a society of cooperatingobjects
assembled to carry out some purpose. A collaboration contains slots thatare
filled by objects and links at run time. A collaboration slot is called a
rolebecauseitdescribesthe purposeofanobjectorlinkwithinthecollaboration.
26
DEPLOYMENTDIAGRAM
Deployment diagrams are a set of nodes and their relationships. These nodes
arephysicalentitieswherethecomponentsaredeployed.Thedeploymentviewrepresent
sthearrangementofruntimecomponentinstancesonnodeinstances.
27
Program-
04OnlineBookSho
p
1. ABSTRACT
2. REQURIMENT :
2.1 FUNCTIONALREQUIREMENTS
2.2 NON-FUNCTIONALREQUIREMENTS
2.3 TECHNICALREQUIREMENTS
3. DIAGRAMS
3.1 CLASSDIAGRAM
3.2 USECASEDIAGRAM
3.3 ACTIVITYDIAGRAM
3.4 STATECHARTDIAGRAM
3.5 SEQUENCEDIAGRAM
3.6 COMPOMENTDIAGRAM
3.7 DEPLOYMENTDIAGRAM
28
Abstract
The main objective of the projectis to create an online book store that allowsusers
to search and purchase a book online based on title, author and subject. Theselected
books are displayed in a tabular format and the user can order their booksonline
through credit card payment. Using this Website, the user can purchase a
bookonlineinsteadofgoingout toabookstore andwastingtime.
Online Book store is an online web application where the customer can
purchasebooks online. Through a web browser the customers can search for a book
by its titleor author, later can add to the shopping cart and finally purchase using
credit cardtransaction. The user can login using his account details or new customers
can set upanaccountveryquickly.
The Online Book Store Website provides customers with online shopping through
aweb browser. A customer can, create, sign in to his account, place itemsinto
ashoppingcartand purchaseusinghiscreditcarddetails.
The main objective of the project is to create an online book store that allows
usersto search and purchase a book basedon title, author and subject. The
selectedbooks are displayed in a tabular format and the user can order their books
onlinethrough credit card payment. The Administrator will have additional
functionalitieswhencomparedtothecommonuser.
Themotivationtocreatethisprojecthasmanysources
Interesttodevelopagooduser-friendlywebsitewithmanyonlinetransactionsusingadatabase.
Toincreasemyknowledgehorizonintechnologieslike.NET,SQL,CSS,HTML.Togain
good experiencein.NETbeforejoininginafull-timejob.
TogainexpertiseusingDataGrid,DataSet,DataTable,DataAdapterandDataReaders.
29
REQUIREMENTS:
FunctionalRequirements
1. Anewuserwhichisnotregisteredinthesystem.Registrationformmustbeavailab
le.Detailsmustbecorrect.
2. MembermustberegisteredagainstuniqueID
3. Books mustbeavailable
4. Wemusthavelibrarianaccountwhichmanagesthewholesystem.
Non-functionalRequirements
1. Performance
2. Quality
3. Secureaccessofconfidentialdata(user’sdetails).
4. 24X7availability
TechnicalRequirements
1. Browser
2. Server
3. MySQL
4. PHP
5. Javascript
6. HTML&CSS
30
DIAGRAMS:
CLASSDIAGRAM
31
UseCaseDiagram
ACTIVITYDIAGRAM
32
STATECHARTDIAGRAM
SequenceDiagram
33
ComponentDiagram
DeploymentDiagram
34
Program-05
RAILWAYRESERVATIONSYSTEM
1 ABSTRACT
2 REQUIREMENTS:
1. FUNCTIONALREQUIREMENTS
2. NON-FUNCTIONALREQUIREMENTS
3. TECHNICALREQUIREMENTS
3 DIAGRAMS:
1. CLASSDIAGRAM
2. OBJECTDIGRAM
3. USECASEDIAGRAM
4. ACTIVITYDIAGRAM
5. STATECHARTDIAGRAM
6. SEQUENCEDIAGRAM
7. COLLABORATIONDIAGRAM
8. DEPLOYMENTDIAGRAM
35
ABSTRACT
Thisapplicationgivescurrentstatusof reservationsofparticulartrain,faresfordifferent
classes of train and also waiting status. For this application, a visitor mustregister to
avail the service. In this system, train records are maintained and
retrieved.Administratormonitorsallusersandtheirtransactions.
Administrator has complete access to database and can add train or cancel train or
addstation for particular train or skip a station for train.There are several
paymentoptions for user like credit card, debit card and a user can also cancel ticket.
Thisapplication also provides current position of train i.e., name of
stationsbetweenwhichthetrainiscurrentlyrunning.
Itprovidesfamiliarandattractiveinterfacewithinsertingandreportingcapabilities.
36
REQUIREMENTS:
Functionalrequirements
1. SecureregistrationandprofilemanagementfacilitiesforCustomers
2. SecuredmechanismforPayment
3. 3Accountmanagement
Non-functionalRequirements
1. Performance
2. Quality
3. Secureaccessofconfidentialdata(user’sdetails).
4. 24X7availability
TechnicalRequirements
1. Browser
2. Server
3. MySQL
4. PHP
5. Javascript
6. HTML&CSS
37
CLASSDIAGRAM:
Aclassdiagramisdescriptionofsetofobjectsthatsharesameattributes,operations,meth
ods,relationshipsand semantics.
38
OBJECTDIAGRAM:
Object diagram describes the static structure of the system at any instant. In
ourcase a registered users “Rites” and “Rajendra” access the database to see
thedetails of book ticket. Rites books a ticket from pine to Mumbai by
Sahyadriexpress.Rajendrabooks
aticketfromDelhitoMumbaibyRajdhaniexpress.
PondlikeisadministratorwithAdmin_id=1.
39
USECASEDIAGRAM:
40
ActivityDiagram
41
STATECHARTDIAGRAM
42
STATES:
1. Authenticationandloggedin
2. Trainavailability
3. Bookticket
4. Payment
5. Showticket
6. History
7. Cancelticket
8. Refund
9. LogoutT
RANSITIONS:
1. Authenticate-Loggedin
2. Loggedin–Entertraindetails–Trainavailability–Enterpassengerdetails
–Bookingticket–Enterpaymentinfo–Pay–Showticket-Logout
3. Loggedin–Checkprevioustickets –Cancelticket–Refund-Logout
43
SEQUENCEDIAGRAM:
44
COLLABORATIONDIAGRAM:
45
DEPLOYMENTDIAGRAM:
Deployment diagrams are a set of nodes and their relationships. These nodes
arephysical entities where the components are deployed. The deployment
viewrepresents the arrangement of runtime componentinstances on node
instances.A node is a runtime resource, such as a computer, device, or memory.
This viewpermits the consequences of distribution and resource allocation to be
assessed.Deployment diagrams are used for visualizing deployment view of a
system.This is generally used by the deployment team. So, the deployment
diagrams areusedtodescribethestaticviewof system.Whenweare goingto build
asoftware intensive system, you have to consider both its logical and
physicaldimensions. On the logical side, you'll find things such as classes,
interfaces,collaborations, interactions, and state machines. On the physical side,
we'll findcomponents andnodewhichareusedinthedeploymentdiagram.
46
Program-
06BankingSyste
m
1 ABSTRACT
2 REQUIREMENTS:
2.1 FUNCTIONALREQUIREMENTS
2.2 NON-FUNCTIONALREQUIREMENTS
2.3 TECHNICALREQUIREMENTS
3. DIAGRAMS:
3.1 CLASSDIAGRAM
3.2 USECASEDIAGRAM
3.3 SEQUENCEDIAGRAM
3.4 COLLABORATIONDIAGRAM
3.6 STATECHARTDIAGRAM
3.7 ACTIVITYDIAGRAM
3.8 COMPOMENTDIAGRAM
3.9 DEPLOYMENTDIAGRAM
47
ABSTRACT
This project aims at creation of a secure Internet banking system. This will
beaccessible to all customers who have a valid User Id and Password. This is
anapproachtoprovideanopportunity
tothecustomerstohavesomeimportanttransactions to be done from where they are at
present without moving to bank. Inthis project we are going to deal the existing
facts in the bank i.e.; the
transactionswhichtakesplacebetweencustomerandbank.Weprovidearealtimeenviron
ment for the existing system in the bank. We deal in the method transactionin the
bank can be made faster and easier that is our project is an internet
basedcomputerized approachtowardsbanking.
Modules:1.Balanceenquiry
2. FundsTransfertoanotheraccount inthesamebank
3. Requestforchequebook/changeofaddress/stoppaymentofCheques
4. ViewingMonthlyandannualstatements.
48
REQUIREMENTS:
FunctionalRequirements
PurposeToregisteranewcustomer.
InputsTherequireddataforregistrationofanewcustomerinthebank(LikeName,Ad
dress,Designationetc.).
ASuccessMessagebedisplayedonsuccessfulregistrationorelseanerrormessa
gewillbedisplayed.
Non-functionalRequirements
1. Performance
2. Quality
3. Secureaccessofconfidentialdata(user’sdetails).
4. 24X7availability
TechnicalRequirements
1. Browser
2. Server
3. MySQL
4. PHP
5. Javascript
6. HTML&CSS
49
ClassDiagram
UseCaseDiagram
50
SequenceDiagram
CollaborationDiagram
51
StatechartDiagram
ActivityDiagram
52
ComponentDiagram
DeploymentDiagram
53
Program-07
Todesigna DocumentEditor
Thiscasestudyisthedesignofa"What-You-See-Is-What-You-
Get"(or"WYSIWYG")documenteditorcalledLexi.1We'llseehowdesignpatternscaptu
re solutions to design problems in Lexi and applications like it. By the end ofthis
chapter, you will have gained experience with eight patterns, learning them
byexample.
Figure:Lexi'suserinterface
54
DesignProblems
Wewillexaminesevenproblems inLexi'sdesign:
55
DocumentStructure
Lexi's user interface should let users manipulate these substructures directly.
Forexample, a user shouldbe able to treat a diagram asa unitrather than
asacollection of individual graphical primitives. The user should be able to refer to
atable as a whole, not as an unstructured mass of text and graphics. That helps
makethe interface simple and intuitive. To give Lexi's implementation similar
qualities,we'llchooseaninternalrepresentationthatmatchesthedocument'sphysicalstru
cture.
Inparticular,theinternalrepresentationshouldsupportthefollowing:
In addition to these goals are some constraints. First, we should treat text
andgraphics uniformly. The application's interface lets the user embed text
withingraphics freely and vice versa. We should avoid treating graphics as a
special caseof text or text as a special case of graphics; otherwise, we'll end up
with redundantformatting and manipulation mechanisms. One set of mechanisms
should sufficeforbothtext andgraphics.
56
Glyphs
We'll define a Glyph abstract class for all objects that can appear in a
documentstructure.3Its subclasses define both primitive graphical elements (like
charactersand images) and structural elements (like rows and columns). Figure
depicts arepresentativepart
oftheGlyphclasshierarchy,andpresentsthebasicglyphinterfaceinmoredetailusingC+
+notation.
Responsibility Operations
appearance virtual void Draw
(Window*)virtualvoid Bounds(Rect&)
hitdetection virtualboolIntersects(constPoint&)
structure virtual void Insert (Glyph*, int)virtual
void
Remove(Glyph*)virtual
Glyph*
Child(int)virtualGlyph*Parent()
Table:Basicglyphinterface
57
Formatting
CompositorandComposition
Responsibility Operations
whattoformat voidSetComposition(Composition*)
whentoformat virtualvoidCompose()
58
Figure:CompositionandCompositorclassrelationships
An unformatted Composition object contains only the visible glyphs that make
upthedocument'sbasiccontent.Itdoesn'tcontainglyphsthatdeterminethedocument's
physical structure, such as Row and Column. The composition is
inthisstatejustafterit'screatedandinitializedwiththeglyphsitshouldformat.When the
composition needs formatting, it calls itscompositor'sCompose operation.
Thecompositor in turn iterates through the composition'schildren and inserts new
Row and Column glyphs according to its line breakingalgorithm. 7Figure shows the
resulting object structure. Glyphs that the compositorcreated and inserted into the
object structure appear with gray backgrounds in thefigure.
Monoglyph
voidMonoGlyph::Draw(Window*w){
_component->Draw(w);
}
59
Figure:MonoGlyphclassrelationships
MonoGlyphsubclassesreimplementatleastoneoftheseforwardingoperations.Border::
Draw,forinstance,firstinvokesthe parent classoperation MonoGlyph::Draw on the
component to let the component do its part—that is, draw everything but the
border. Then Border::Draw draws the border
bycallingaprivateoperationcalledDrawBorder, thedetailsofwhichwe'llomit:
voidBorder::Draw(Window*w)
{MonoGlyph::Draw(w);DrawBord
er(w);
}
Notice how Border::Draw effectively extends the parent class operation to draw
theborder. This is in contrast to merely replacing the parent class operation,
whichwouldomitthecalltoMonoGlyph::Draw.
60
VisitorPattern
An important question to ask yourself before applying the Visitor pattern is,
Whichclass hierarchies change most often? The pattern is most suitable when you
want tobeabletodoavariety of differentthingstoobjectsthat havea
stableclassstructure. Adding a new kind of visitor requires no change to that class
structure,which is especially important when the class structure is large. But
whenever youadd a subclass to the structure, you'll also have to update all your
visitor interfacesto include a Visit... operation for that subclass. In our example that
means adding anew Glyph subclass called Foo will require changing Visitor and all
its subclassesto include a VisitFoo operation. But given our design constraints,
we're much morelikely to add a new kind of analysis to Lexi than a new kind of
Glyph. So theVisitorpatterniswell-suited toourneeds.
ConcludingRemarks
designreuse
uniformdesignvocabulary
understanding,restructuring,&team
communicationprovidesthebasisforautomation
a“new”waytothinkaboutdesign
61