cisc 323 week 11
play

CISC 323 (Week 11) Due Date: Thursday, April 7, 2005 (3:00pm) - PowerPoint PPT Presentation

Assignment #5 CISC 323 (Week 11) Due Date: Thursday, April 7, 2005 (3:00pm) Architectural Styles The only task: Write a complete CD catalog program with editing features, following your design from Assignment 4. You may re-use any


  1. Assignment #5 CISC 323 (Week 11) � Due Date: Thursday, April 7, 2005 (3:00pm) Architectural Styles � The only task: Write a complete CD catalog program with editing features, following your design from Assignment 4. � You may re-use any code you wish from Assignments 1 and 2 -- your own code and/or code posted as a solution. Jeremy Bradbury � If you encounter design problems… Teaching Assistant � It is quite possible that you will find problems in your design from Assignment 4. You may have left something out, or you March 30, 2005 may find that a particular method would be easier to use and/or implement if its parameters were different. In the real world, you bradbury@cs.queensu.ca would ideally go back and fix your design. For this assignment, you may instead list for us the ways your implementation disagrees with your design and why you made these decisions. Jeremy Bradbury (CISC 323) March 30, 2005 Assignment #5 Architectural Styles � Marking Scheme: This assignment is worth a total of � Client-Server 20 marks. � Pipe and Filter Correctness: 14 Follows Design: 3 � Layers Style: 3 � Event-based (Implicit Invocation) � For incomplete programs, the correctness points will be broken down as follows: � Repository change basic CD information (title, composer, performer, tag): 3 � Data Abstraction and Object-Oriented delete a CD: 2 change track information (title, composer, performer): 3 Organization delete a track from a CD: 2 add a new track to a CD: 2 add a new CD to a catalog: 2 Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005

  2. Past Midterm/Exam Questions Past Midterm/Exam Questions � Answer: The difference is the scale or level at which � Question 1, Midterm 2002 (5 pts): What is they are applied. the difference between a design pattern and � A design pattern describes a relationship between an architectural style? individual classes to solve a small problem inside a larger system. Design patterns are also called micro- architectures. (Note this question was also on the Final in 2003 and worth 3 pts) � An architectural style is a way of breaking up a large system into subsystems or components, each of which may contain multiple classes. � Each component in a system may use one or more design patterns to structure the relationships between the classes in the component. Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005 Client-Server Architectural Style Pipe and Filter Architectural Style � Components: Servers and clients � Components: Set of data filters � Constraints: requests only sent by clients and � Connectors/interaction: Data is passed from one responses only sent by servers filter to the next via pipes � Examples: � Constraints: Data is passed in sequence from one � WWW filter to the next � Clients: Browsers � Servers: Web servers � Email � Clients: Programs to read and write email (Outlook, mail, pine, Eudora) � Servers: “Mail-drop” machine that Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005

  3. Pipe and Filter Architectural Style Past Midterm/Exam Questions � Question 6, Midterm 2002 (10 pts): From � Example: compiler the lecture material, describe two types of changes that are very easy to make when using the pipe-and-filter architectural style. Describe a type of change that is very difficult to make when using the pipe-and-filter architectural style. (Note: Students in 2002 also had an assignment on pipe-and-filter) Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005 Past Midterm/Exam Questions Layered Architectural Style � Solution: Most common valid answers: � Components: the layers � Connectors/interactions: Protocols � Easy Change: Add a new filter, since this for communication between layers requires only changes to two connectors. � Constraints: Each component allowed � Easy Change: Modify an existing filter, so long to use services in interface of layer as the input and output data formats are below it. Provides interface to layer unaffected. above it. � Difficult Change: Modify the data structure � Domain: Whenever problem can be (format), since it can potentially affect every decomposed into sequence of layers filter in the system. each with strong cohesion Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005

  4. Layered Architectural Style Past Midterm/Exam Questions � Question 5, Final 2003 (6 pts): You have been � Example: web browser given a badly-written software system to update. You decide to re-write it completely and to use a Layered architectural style. How will your new system compare to the old system with regards to the following three attributes? Coupling, Performance (time), and Modifiability. � For example, would you expect your new system to have higher or lower coupling than the old system and why? Please restrict yourself to one or two sentences for each attribute. Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005 Past Midterm/Exam Questions Past Midterm/Exam Questions � Solution: � Question 1.2, Final 2002 (5 points): When we discussed the layered architectural style in class, � Coupling: Lower because components only communicate with the components directly we focused on a strict layering approach (layers above and below. can only interact with the layers directly above � Performance (time): Greater time required and below them). In many real systems, the because components can only interact with layered architecture breaks down, with method adjacent components. calls often bypassing one or more layers. Briefly � Modifiability: Higher because only adjacent explain one (1) reason why developers may components are directly dependent on any choose to do this, and one (1) reason why this is given component. a bad idea. Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005

  5. Event-based Architectural Style Past Midterm/Exam Questions (Implicit Invocation) � Components: send and subscribe to events � Solution: � Connectors/interaction: event connector (a.k.a � One reason why developers may choose to do dispatcher) keeps track of: this: Performance � which components are interested in which events � One reason why this is a bad idea: high � which method m in an interested component C is to coupling or decreased modifiability be invoked upon the announcement of an event e by storing a set of bindings (e, C, m) � Constraints: Announcing components do not know who will receive their events (anonymity), in which order events will be delivered, or what receiving components will do in response. Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005 Event-based Architectural Style Repository Architectural Style (Implicit Invocation) � Components : a central data � Example: a program development environment. structure (repository) represents (parts of) state � information that is to be shared components have direct access to � it e.g.: data bases, files, shared � memory components that access repository � Connector/interactions : components can invoke each � other components read/write � information from/to repository repository passive � Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005

  6. Repository Architectural Style Past Midterm/Exam Questions � Example: Compiler with pipe and filter and � Question 1, Midterm 2002 (5 pts): Describe repository the difference between the pipe-and-filter architectural style and the repository architectural style. (Note this question was also on the Final in 2003 and worth 3 pts) Jeremy Bradbury (CISC 323) Jeremy Bradbury (CISC 323) March 30, 2005 March 30, 2005 Past Midterm/Exam Questions � Solution: � In a pipe-and-filter architecture, each filter operates on the data sequentially. Each filter reads one or more stream of data and outputs one or more streams of data – maybe in the same format(s) or maybe in different formats. The only communication between the components (filters) is the data streams passing between them. � In a repository architecture, there is a common pool of data in a fixed format. All of the components access and modify this data. They don't necessarily do this sequentially. � The main point is data streams passing through filters vs. a shared pool of data. Jeremy Bradbury (CISC 323) March 30, 2005

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend