100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CO2401 Software Development Lecture 15 Notes £3.48   Add to cart

Lecture notes

CO2401 Software Development Lecture 15 Notes

 8 views  0 purchase

This document contains comprehensive notes from Lecture 15 of the CO2401 course on Software Development. The lecture focuses on Structural and Behavioral Design Patterns, which are essential tools for solving common software design problems in a flexible and reusable manner.

Preview 1 out of 4  pages

  • August 22, 2024
  • 4
  • 2023/2024
  • Lecture notes
  • Muhammad alhassan
  • All classes
All documents for this subject (20)
avatar-seller
BpoBpo
CO2401: Software Development
Lecture 15

Structural Patterns
1. Composite Pattern
o Problem:

 Used when an application’s model can be represented as a
tree structure, such as an order containing products packed
in boxes within boxes.
 Challenge: Calculating the total price of such an order.
o Solution:

 Use a common interface for both products and boxes, with a
method to calculate the total price.
 For a product: Return its price.
 For a box: Iterate over its contents, summing up prices,
including any additional costs like packaging.
2. When to Use:
o Implement a tree-like structure in your object model.

o Enable client code to treat simple and complex elements uniformly.

3. Pros and Cons:
o Benefits:

 Simplifies working with complex tree structures.
 Allows new element types to be added without breaking
existing code.
o Drawbacks:

 Difficulty in providing a common interface for classes with
significantly different functionalities.




Adapter Pattern

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller BpoBpo. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for £3.48. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73314 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy revision notes and other study material for 14 years now

Start selling
£3.48
  • (0)
  Add to cart