100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS3711 Exam Portfolio 2024 R48,80
Add to cart

Exam (elaborations)

COS3711 Exam Portfolio 2024

 7 views  0 purchase

COS3711 Exam Portfolio 2024

Preview 4 out of 41  pages

  • November 2, 2024
  • 41
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (52)
avatar-seller
kevinlugwiri98
COS3711 EXAM
PACK 2024

QUESTIONS AND
ANSWERS
FOR ASSISTANCE CONTACT
EMAIL:kevinlugwiri98@gmail.com

, lOMoARcPSD|31863004




COS3711 Summary
For: An Introduction to Design Patterns in C++ with Q
By: Wilco Breedt

, lOMoARcPSD|44660598




1. UML Class Diagrams



A UML class diagram represents the static structure of a system, showing how classes are
related. Here’s what you should focus on:



• Classes: Represent entities with attributes and methods.

• Relationships: Use arrows to show inheritance, aggregation, composition,
and associations.

• Attributes and Methods: Represent key data and operations in the classes.



Example: Book and Magazine Tracking System (From 2023 Paper )



Let’s assume we are tasked with creating a system to track books and magazines. Both
have names, and books have publishers, while magazines have frequencies.



Class Diagram Requirements:



• An Item class with basic attributes (name).

• Two subclasses Book and Magazine, inheriting from Item.

• The Client class, which holds a list of items (QList<Item*>).



Here’s a basic UML class diagram:



• Item: +name: QString (parent class)

• Book: +publisher: QString (inherits from Item)

• Magazine: +frequency: QString (inherits from Item)

• Client: -items: QList<Item*>

, lOMoARcPSD|44660598




This diagram shows:



• Inheritance: Books and magazines inherit from Item.

• Aggregation: The Client class contains a list of Item.



Key Tips for UML Diagrams:



• Use arrows for inheritance (open arrowheads).

• Use diamonds for aggregation (white) or composition (black).

• Don’t clutter diagrams with too many details; focus on key classes,
attributes, and relationships.



2. Design Patterns



Design patterns are recurring solutions to common software design problems. In
COS3711, you focus on Strategy, Singleton, and Factory Method patterns.



a. Strategy Pattern



This pattern is used to define a family of algorithms, encapsulate each one, and make them
interchangeable.



Example: Communication System (From 2021 Paper )

In the communication system, users can send messages via Signal, SMS, or WhatsApp.



Steps to Implement:

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 EFT, credit card or Stuvia-credit 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 this summary from?

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

Will I be stuck with a subscription?

No, you only buy this summary for R48,80. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

50990 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 15 years now

Start selling
R48,80
  • (0)
Add to cart
Added