
create a "UML Class Diagram" with the files below. I attempted to mae it myself, but I dont know if its right or not.
Application.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
import java.awt.print.Paper;
/**
*
* @author MoaathAlrajab
*/
public class Application {
//Application to describe a publication
privateWrittenPiecepaper ;
privateIllustrationdrawing;
publicApplication(WritingFactoryfactory) {
drawing = factory.drawSomething();
paper = factory.writeSomething();
}
publicvoidrevealContent(){
paper.typeOfPiece();
drawing.depictInfo();
}
}
Book.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class Book implements WrittenPiece {
@Override
publicvoidtypeOfPiece() {
System.out.println("Book is a written piece");
}
}
Charts.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class Charts implements Illustration {
@Override
publicvoiddepictInfo() {
System.out.println("Charts is a type of illustration usually included+"
+ "in written pieces such as books and articles. ");
}
}
ComicBookFactory.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class ComicBookFactory implements WritingFactory {
@Override
publicIllustrationdrawSomething() {
returnnewHandDrawing();
}
@Override
publicWrittenPiecewriteSomething() {
returnnewBook();
}
}
DriverClass.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class DriverClass {
privatestaticApplicationconfigureApplication(){
Applicationapp;
WritingFactoryfactory;
StringprintName = "Check the config file for cominc";
if (printName.contains("paper")) {
factory = newComicBookFactory();
app = newApplication(factory);
} else {
factory = newMenuscriptFactory();
app = newApplication(factory);
}
returnapp;
}
publicstaticvoidmain(String[] args) {
Applicationapp = configureApplication();
app.revealContent();
}
}
Essay.java
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class Essay implements WrittenPiece {
@Override
publicvoidtypeOfPiece() {
System.out.println("Essay is a written piece");
}
}
HandDrawing.java:/
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class HandDrawing implements Illustration {
@Override
publicvoiddepictInfo() {
System.out.println("Hand drawing is traditionally the meaning "
+ "of illustration ");
}
}
Illustration.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public interface Illustration {
voiddepictInfo();
}
MenuscriptFactory.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class MenuscriptFactory implements WritingFactory {
@Override
publicIllustrationdrawSomething() {
returnnewCharts();
}
@Override
publicWrittenPiecewriteSomething() {
returnnewPublicationPaper();
}
}
PublicationPaper.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class PublicationPaper implements WrittenPiece{
@Override
publicvoidtypeOfPiece() {
System.out.println("This is a publication article");
}
WritingFactory.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public interface WritingFactory {
Illustration drawSomething();
WrittenPiece writeSomething();
}
WrittenPiece.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public interface WrittenPiece {
void typeOfPiece();
}


Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

- I need this assignment done in java with screenshots of it running.arrow_forward● • Compile the Automobile.java class and correct any errors. Create another file named TestAutomobile.java that contains the main method. Create several Automobile objects and test that your constructor and methods work as described. ● Create a UML diagram of the Automobile class. Create the Automobile.java class. It should have the instance variables, constructor(s) and methods located below. Automobile Instance variables Reminder: + indicates public, - indicates private - make (String): The automobile make (Ford, Acura, etc). - model (String): The automobile model (Escapade, ZDX, etc). - power (boolean): Holds the value true if the power is on and false if the power is off. The default value is false. . - gear (char): Holds the value of the gear that the automobile is in. The default value is P (Park). Other values include D (Drive), and R (Reverse). Automobile constructors • One constructor that takes two parameters and sets the make and model instance variables. . - volume (int):…arrow_forwardRefer to the following interface: Provide two examples (screenshots) that in many ways could improve the above or similar interface using the principles of direct manipulation. Explain the relevant improvements as well. (Examples might have different object, labels and organization)arrow_forward
- Please teach me how to fix an error from my JAVA source code. I have set up the source code with class name "ProductionWorker" and there were a error occured on second page of sceenshot where it is highlighted. //import the file import java.util.*; //create the class class Employee { //create the variable private String emp_num; //create the date variable private Date hiring_date; // default constructor public Employee() { //assign the emp num. this.emp_num = "000-A"; //assign the Date this.hiring_date = new Date(); } // constructor parameter public Employee(String emp_num, Date hiring_date) { this.emp_num = emp_num; this.hiring_date = hiring_date; } // getter method public String getEmployeeNumber() { return this.emp_num; } // call the gethiringdate function public Date gethiringDate() { // return the date return this.hiring_date; } // setter method public void setEmployeeNumber(String emp_num) { //set the emp num. this.emp_num = emp_num; } //set the hiring date public void…arrow_forwardTo use any of the prewritten classes besides those in the java.lang package, you must___ a. use the entire path with the class name b. import the class c. import the package of which the class you are using is a part d. use any of these methodsarrow_forwardModalProp detailsanimationType it's an enum of ('none', 'slide', 'fade') and it controls modal animation.visible its a bool that controls modal visiblity.onShow it allows passing a function that will be called once the modal has been shown.transparent bool to set transparency.onRequestClose (android) it always defining a method that will be called when user tabs back buttononOrientationChange (IOS) it always defining a method that will be called when orientation changessupportedOrientations (IOS) enum('portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right')Modal component is a simple way to present content above an enclosing view.using given Modal make a Basic Example?arrow_forward
- When comparing two objects using the equals method inherited from the Object class, what is actually compared is the contents of the objects in java. True or Falsearrow_forward8arrow_forwardIn python and include doctring: First, write a class named Movie that has four data members: title, genre, director, and year. It should have: an init method that takes as arguments the title, genre, director, and year (in that order) and assigns them to the data members. The year is an integer and the others are strings. get methods for each of the data members (get_title, get_genre, get_director, and get_year). Next write a class named StreamingService that has two data members: name and catalog. the catalog is a dictionary of Movies, with the titles as the keys and the Movie objects as the corresponding values (you can assume there aren't any Movies with the same title). The StreamingService class should have: an init method that takes the name as an argument, and assigns it to the name data member. The catalog data member should be initialized to an empty dictionary. get methods for each of the data members (get_name and get_catalog). a method named add_movie that takes a Movie…arrow_forward
- JAVA PROGRAMMING Create a class named "Circle" that has attributes radius, area and circumference and make the attributes private. Make a public method that sets the radius and method that prints all attributes. Ask the user input for radius. Note: Use the PI from the math functions. Inputs: 1. A line containing an integer. 10 Output: Radius: 20 Area: 1256.64 Circumference: 125.66arrow_forwardJava Code. Create a Driver class to use your Farm and Animal classes and create instances of them. In the main method do the following: Create a Farm of size 10 Create 5 Animal Objects with the details specified in the table below Add the 5 Animal objects to the Farm Call the printDetails method from the Farm to print all the Farm and Animal details.arrow_forwardCan you please help me with this, its in java. Thank you. Write classes in an inheritance hierarchy Implement a polymorphic method Create an ArrayList object Use ArrayList methods For this, please design and write a Java program to keep track of various menu items. Your program will store, display and modify salads, sandwiches and frozen yogurts. Present the user with the following menu options: Actions: 1) Add a salad2) Add a sandwich3) Add a frozen yogurt4) Display an item5) Display all items6) Add a topping to an item9) QuitIf the user does not enter one of these options, then display:Sorry, <NUMBER> is not a valid option.Where <NUMBER> is the user's input. All menu items have the following: Name (String) Price (double) Topping (StringBuilder or StringBuffer of comma separated values) In addition to everything that a menu item has, a main dish (salad or sandwich) also has: Side (String) A salad also has: Dressing (String) A sandwich also has: Bread type…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





