Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

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();
       
}

WritingFactory
+drawSomething
+writeSomething()
ComicBookFactory
Application
-paper:
WrittenPiece
-drawing:
Illustration
+drawSomething
+writeSomething
Charts
+depictinfo()
Implements
PublicationPaper
+typeOfPiece()
Uses
Implements
Implements
WrittenPiece
+typeOfPiece()
Book
+typeOfPiece()
Implements
MenuscriptFactory
Uses
+drawSomething
writeSomething
DriverClass
Implements
+drawSomething
+writeSomething
llustration
Essay
+typeOfPiece()
HandDrawing
+depictinfo()
createlllustration)
+createWrittenPiece()
Implements
expand button
Transcribed Image Text:WritingFactory +drawSomething +writeSomething() ComicBookFactory Application -paper: WrittenPiece -drawing: Illustration +drawSomething +writeSomething Charts +depictinfo() Implements PublicationPaper +typeOfPiece() Uses Implements Implements WrittenPiece +typeOfPiece() Book +typeOfPiece() Implements MenuscriptFactory Uses +drawSomething writeSomething DriverClass Implements +drawSomething +writeSomething llustration Essay +typeOfPiece() HandDrawing +depictinfo() createlllustration) +createWrittenPiece() Implements
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education