Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this exercise we will design and implement interaction between different entities. We are assuming we have two main entities and implementing their fields and

image text in transcribed
In this exercise we will design and implement interaction between different entities.
We are assuming we have two main entities and implementing their fields and methods that support their interaction.
Suppose we have a NewsPublisher that produces news data through a publish action; and we have one or many NewsReader that subscribe to the NewsPublisher, and need to be notified whenever a news article is published. A NewsReader is notified of a new article through the action readNews. Check the image below.
a. A NewsPublisher must be able to Register a NewsReader (that wants to get notified).
b. A NewsPublisher must be able to UnRegister a NewsReader (that does Not want to get notified).
c. A NewsPublisher is updated through a method that it must implement called setNewsArticle that takes a news article as a parameter. The news article data is just a string of the following format: [news article number - news article text] for example: 123 - this is a news article text.
d. The setNewsArticle method is the first method to be called and it triggers the notification process.
e. A NewsPublisher notifies every subscribed NewsReader that a news is published
f. A NewsPublisher also prints to the output window the statement:
NewsPublisher : A new Article is Published when it publishes an article
g. A NewsReader must support the ReadNews action where it prints a statement saying that it read the news, the statement is of the following format: NewsReader [NewsReader Number] read the news: [news article number - news article text]
Questions:
1. Develop a UML Class diagram that represents the interfaces, classes, methods and associations between Classes.
2. Develop a UML Sequence diagram that represents the method calls between objects.
3. Implement the UML design into a C# program and write a client class to test the implemented code.
In this exercise we will design and implement interaction between different entities. We are assuming we have two main entities and implementing their fields and methods that support their interaction Suppose we have a NewsPublisher that produces news data through a publish action, and we have one or many NewsReader that subscribe to the NewsPublisher, and need to be notified whenever a news article is published. A NewsReader is notified of a new article through the action readNews. Check the image below. a. A NewsPublisher must be able to Register a NewsReader (that wants to get notified) b. A News Publisher must be able to UnRegister a NewsReader (that does Not want to get notified). c. A News Publisher is updated through a method that it must implement called setNewsArticle that takes a news article as a parameter. The news article data is just a string of the following format: [news article number - news article text] for example: "123 - this is a news article text" d. The setNewsArticle method is the first method to be called and it triggers the notification process. e. A NewsPublisher notifies every subscribed NewsReader that a news is published 1.A NewsPublisher also prints to the output window the statement: "News Publisher : A new Article is Published" when it publishes an article 8. A NewsReader must support the ReadNews action where it prints a statement saying that it read the news, the statement is of the following format: "NewsReader [NewsReader Number] read the news: [news article number - news article text]" Questions: 1. Develop a UML Class diagram that represents the interfaces, classes, methods and associations between Classes 2. Develop a UML Sequence diagram that represents the method calls between objects. 3. Implement the UML design into a C program and write a client class to test the implemented code NewsReader NewsReaded ReadNews ReadNews NewsPublished

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago