System Design ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University
Decomposition ... ... ... System Subsystem1 SubsystemN Class1a Class1n ClassNa ClassNn
Coupling and cohesion Coupling -- # of dependencies between subsystems Cohesion -- # of dependencies within subsystem Goal: low coupling, high cohesion 7 +/- 2 rule – keep number of concepts at any given layer of abstraction bounded
Layers and Partitions Layer – group of related subsystems Layer knows about layers below it, but not layers above it Top layer: no one else knows about it Closed architecture – can only access layer immediately below Open architecture – can access any layer below Partition – peer subsystems, each with different responsibilities
Hierarchical decomposition Application Presentation Session Transport Network DataLink Physical Socket CORBA TCP/IP Object Ethernet Wire Frame Packet Bit Connection Format Message Level of abstraction Example: Open Systems Interconnection (OSI)
Architectural Styles Repository – subsystems interact through single repository Model / View / Controller Client / Server Three-tier Four-tier Pipe and filter
Model / View / Controller (MVC) Model subsystems maintain domain knowledge View subsystems display it to the user Controller subsystems manage sequence of interactions with user M doesn’t depend upon V or C Changes propagated via subscribe/notify protocol, using Observer design pattern Well-suited for interactive systems
MVC Details Controller Model subscriber notifier initiator * repository 1 View
MVC Example
MVC Example Details 2:enterNewFileName(file,newName) 3:setName(newName) :Controller :Model 1:subscribeToFileEvents(file) 5:getName() :InfoView 4:notifySubscribedViews(file) 4:notifySubscribedViews(file) :FolderView 1:subscribeToFileEvents(file) 5:getName()