Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Based on the description below, I need to do 2 things: 1) draw a class diagram that implements the abstract factory pattern and singleton pattern

Based on the description below, I need to do 2 things:

1) draw a class diagram that implements the abstract factory pattern and singleton pattern and

2) write java code that goes along with it.

The java code has to read in content from a text file with content such as: "Word90 Word00 Word90 Word18 Word10 Word00 Word18 Word90 Word00"

Upon reading in each line of text, we need to print Panel Word+version based on which version of Word it is. So the first line would read in Word90 and output "Panel Word90", "Button Word90", "TextBox Word90" and the second line would output "Panel Word00", "Button00", "TextBox00" and so on. However, we need to use the singleton pattern to ensure that if one of the Word versions is called more than twice, we display a warning message such as "WARNING: No more than 2 instances allowed".

Here is the text description of what needs to be implemented: A software company MicroOffice has produced four generations of Word Processing Applications, called Word 90, Word00, Word I0, and Word I8. Suppose you are writing a program to test their GUIs. The GUI components we are interested in are Panel, Button, and Textbox. These GUI components look a little different in different generation. Each generation has it own program for testing these GUI components. To know which test to run, you will need to instantiate objects that correspond to each one of the GUI components.

We assume that generations of the Word to be tested are stored in a configuration file (text file). Because this situation fits the Abstract Factory pattern so well, you can use that pattern to organize the creation of objects that correspond to GUI components. You will also need to use the variation of singleton pattern to ensure that at most two instances of each generation in each test run. Please note finishing running all generations specified in the configuration file is considered as one test run.

Thank you in advance!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions