Question

Draw Class diagrams with all the classes and their relationships on swap/trade and buying a book...

Draw Class diagrams with all the classes and their relationships on swap/trade and buying a book on a web application. No description needed,. Use starUML to draw the diagrams. Don't forget to mention the components as private public or protected and other important specification needed in the diagrams.

The following are all the classes and functions of the website

  • Book Class

    • Variables

      • private $author

        • Holds author of the book.

      • private $title

        • Holds title of the book.

      • private $edition

        • Holds the edition of the book. Default is 1st edition.

      • private $genre

        • Holds the genre of the book.

      • private $BID

        • Holds the Book ID from the BOOKS table BID column in the database. BID is a primary key in the BOOKS table.

      • private $picURL

        • Holds the path for the picture.

    • Functions

      •   public function getAuthor()

        • Returns the contents of author variable.

      •   public function setAuthor($value)

        • Sets the author variable to the contents of $value.

      •   public function getPicURL()

        • Returns the contents of author variable.

      •   public function setPicURL($value)

        • Sets the picURL variable to the contents of $value.

      •   public function getTitle()

        • Returns the contents of author variable.

      •   public function setTitle($value)

        • Sets the title variable to the contents of $value.

      •   public function getEdition()

        • Returns the contents of author variable.

      •   public function setEdition($value)

        • Sets the edition variable to the contents of $value.

      •   public function getGenre()

        • Returns the contents of author variable.

      •   public function setGenre($value)

        • Sets the genre variable to the contents of $value.

      •   public function getBID()

        • Returns the contents of author variable.

      •   public function setBID($value)

        • Sets the BID variable to the contents of $value.

  • BookDB Class

    • Functions

      • public static function getBook($BID)

        • Accesses the database and retrieves book data corresponding to the book ID in $BID. It then returns a Book object with that information.

      • public static function getBookByTitle($title)

        • Accesses the database and retrieves book data corresponding to the title in $title. It then returns a Book object with that information.

      • public static function addBook($book)

        • Gets information from the passed in $book object. It then enters that information into the database.

      • public static function removeBook($BID)

        • Removes a book from the database corresponding to the $BID.

  • User Class

    • Variables

      • private $alias

        • Holds username of the user.

      • private $email

        • Holds email of the user.

      • private $UID

        • Holds the User ID from the UID column in USERS database table..

      • private $organiz

        • Holds organization of the user.

      • private $firstName

        • Holds first name of the user.

      • private $lastName

        • Holds last name of the user.

      • private $accType

        • Holds the account type of the user account. Either admin or user.

      • private $password

        • Holds password of the user.

    • Functions

      • public function __construct($alias, $email, $firstName,   $lastName, $organization)

        • Constructor for the User class.

      •   public function getAlias()

        • Returns the contents of alias variable.

      •   public function setAlias($value)

        • Sets the alias variable to the contents of $value.

      •   public function getID()

        • Returns the contents of UID variable.

      •   public function setID($value)

        • Sets the UID variable to the contents of $value.

      •   public function setPassword($value)

        • Sets the password variable to the contents of $value.

      •   public function getPassword()

        • Returns the contents of password variable.

      •   public function getDateJoined()

        • Returns the contents of dateJoined variable.

      •   public function setDateJoined($value)

        • Sets the dateJoined variable to the contents of $value.

      •   public function getEmail()

        • Returns the contents of email variable.

      •   public function setEmail($value)

        • Sets the email variable to the contents of $value.

      •   public function getType()

        • Returns the contents of accType variable.

      •   public function setType($value)

        • Sets the accType variable to the contents of $value.

      •   public function getFirstName()

        • Returns the contents of firstName variable.

      •   public function setFirstName($value)

        • Sets the firstName variable to the contents of $value.

      •   public function getLastName()

        • Returns the contents of lastName variable.

      •   public function setLastName($value)

        • Sets the lastName variable to the contents of $value.

      •   public function getOrganization()

        • Returns the contents of organization variable.

      •   public function setOrganization($value)

        • Sets the organziation variable to the contents of $value.

  • UserDB Class

    • Functions

      • public static function getUser($UID)

        • Retrieves data from the database that corresponds to the passed in $UID. Returns a User object with that information.

      • public static function checkEmail($email)

        • Checks the database to see if the passed in $email is already taken. Returns a boolean value accordingly.

      • public static function addUser($user1)

        • Adds a user to the USERS table according to the information in the passed in $user1 object.

  • Listing Class

    • Variables

      • private $BID

        • Holds the book ID for the book that is used in this listing. This is used for the foreign key in the LISTINGS table.

      • private $sellerID

        • Holds the user ID for the user who posted this listing.

      • private $buyerID

        • Holds the user ID for the user who bought this book.

      • private $datePosted

        • Holds the date this listing was posted.

      • private $transacType

        • Holds what kind of transaction this listing is. Rent, Buy or Trade.

      • private $description

        • Holds the description for the listing.

      • private $LID

        • Holds listing ID which is used as the primary key in the LISTINGS table.

      • private $status

        • Holds the status of the listing. Whether it is completed or still listed.

    • Functions

      •   public function __construct($BID, $sellerID, $datePosted)

      •   public function getBID()

      •   public function setBID($value)

      •   public function getStatus()

      •   public function setStatus($value)

      •   public function getLID()

      •   public function setLID($value)

      •   public function getSellerID()

      •   public function setSellerID($value)

      •   public function getDatePosted()

      •   public function setDatePosted($value)

      •   public function getTransacType()

      •   public function setTransacType($value)

      •   public function getDescription()

      •   public function setDescription($value)

  • ListingDB Class

    • Functions

      • public static function getListingByUID($UID)

      • public static function getListingByLID($LID)

      • public static function getListings()

      • public static function getPurchasesByUID($UID)

      • public static function addListing($listing)

      • public static function removeListing($LID)

  • Comment Class

    • Variables

      • private $CID

      • private $LID

      • private $UID

      • private $comment

      • private $dateCommented

    • Functions

      •   public function getCID()

      •   public function setCID($value)

      •   public function getLID()

      •   public function setLID($value)

      •   public function getUID()

      •   public function setUID($value)

      •   public function setComment($value)

      •   public function getComment()

      •   public function getDateCommented()

      •   public function setDateCommented($value)

  • CommentDB Class

    • Functions

      • public static function postComment($LID, $UID, $comment)

      • public static function getCommentsByLID($LID)

  • Database Class

    • Variables

      •   private static $dsn

      •   private static $username

      •   private static $password

      •   private static $db

    • Functions

      • public static function getDB()

0 0
Add a comment Improve this question Transcribed image text
Answer #1


Prorcess :

USER :

  • userid
  • username
  • mobile
  • address
  • email
  • country
  • city

Book Exchange :

  • Type 1 Attribute
  • Type 2 Attribute
  • Type 3 Attribute
  • Type 4 Attribute
  • exchange()

Book Review :

  • Type 1 Attribute
  • Type 2 Attribute
  • Type 3 Attribute
  • Type 4 Attribute
  • book review ()

Book rating :

  • Type 1 Attribute
  • Type 2 Attribute
  • Type 3 Attribute
  • Type 4 Attribute
  • contain()
  • rate()

Book :

  • Type 1 Attribute
  • Type 2 Attribute
  • Type 3 Attribute
  • Type 4 Attribute
  • post()
  • select()
  • buy()
  • categoty()
  • contain()
  • addto()

Book Category :

  • Type 1 Attribute
  • Type 2 Attribute
  • Type 3 Attribute
  • Type 4 Attribute
  • categories()

User Wishlist:

  • Type 1 Attribute
  • Type 2 Attribute
  • Type 3 Attribute
  • Type 4 Attribute
  • addto()
  • maintain()
Add a comment
Know the answer?
Add Answer to:
Draw Class diagrams with all the classes and their relationships on swap/trade and buying a book...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Implement the classes in the following class diagram. The Book class implements the Comparable interface. Use impl...

    Implement the classes in the following class diagram. The Book class implements the Comparable interface. Use implements Comparable<Book> in the class definition. Now, all book objects are instances of the java.lang.Comparable interface. Write a test program that creates an array of ten books. 1. Use Arrays.sort( Book[]l books) from the java.util package to sort the array. The order of objects in the array is determined using compareTo...) method. 2. Write a method that returns the most expensive book in the...

  • Write a definition for a class named Book with attributes title, price and author, where author...

    Write a definition for a class named Book with attributes title, price and author, where author is a Contact object and title is a String, and price is a float number. You also need to define the Contact class, which has attributes name and email, where name and email are both String. Instantiate a couple of Book objects that represents books with title, price and author (You can come up with the attributes values for each object) Write a function...

  • Look at this partial class definition, and then answer questions a - b below: Class Book...

    Look at this partial class definition, and then answer questions a - b below: Class Book    Private String title    Private String author    Private String publisher    Private Integer copiesSold End Class Write a constructor for this class. The constructor should accept an argument for each of the fields. Write accessor and mutator methods for each field. Look at the following pseudocode class definitions: Class Plant    Public Module message()       Display "I'm a plant."    End Module...

  • (JAVA NetBeans) Write programs in java Example 9.13~9.15 //Book.Java public class Book { private String title; private...

    (JAVA NetBeans) Write programs in java Example 9.13~9.15 //Book.Java public class Book { private String title; private String author; private double price; /** * default constructor */ public Book() { title = ""; author = ""; price = 0.0; } /** * overloaded constructor * * @param newTitle the value to assign to title * @param newAuthor the value to assign to author * @param newPrice the value to assign to price */ public Book(String newTitle, String newAuthor, double newPrice)...

  • Objectives: 1. Classes and Data Abstraction?2. User-defined classes?3. Implementation of a class in separate files Part...

    Objectives: 1. Classes and Data Abstraction?2. User-defined classes?3. Implementation of a class in separate files Part 1: In this assignment, you are asked: Stage1:?Design and implement a class named memberType with the following requirements: An object of memberType holds the following information: • Person’s first name (string)?• Person’s last name (string)?• Member identification number (int) • Number of books purchased (int)?• Amount of money spent (double)?The class memberType has member functions that perform operations on objects of memberType. For the...

  • Create four classes, Trainee, JumpingCalculator, JumpingTraining, and TrainProgLoader. Save them to Trainee.java, JumpingCalculator.java, JumpingTraining.java, and TrainProgLoader.java....

    Create four classes, Trainee, JumpingCalculator, JumpingTraining, and TrainProgLoader. Save them to Trainee.java, JumpingCalculator.java, JumpingTraining.java, and TrainProgLoader.java. Code the classes as specified as follows. Compile and run to test the program. Trainee Class: This class represents a trainee. Fields : A private int data field named id; A private String data field named name; o a private boolean data field named jumpTrain; o a private static int data field named numOfTrainee; Methods: A constructor that takes id and name as the...

  • Writing 3 Java Classes for Student registration /** * A class which maintains basic information about...

    Writing 3 Java Classes for Student registration /** * A class which maintains basic information about an academic course. */ public class Course {    /** * Attributes. */ private String code; private String title; private String dept; // name of department offering the course private int credits; /** * Constructor. */ public Course(String code, String title, int credits) { // TODO : initialize instance variables, use the static method defined in // Registrar to initialize the dept name variable...

  • Modify the library program as follows: Create a method in the LibraryMaterial class that accepts a...

    Modify the library program as follows: Create a method in the LibraryMaterial class that accepts a string s as a parameter and returns true if the title of the string is equal to s. Create the same method for your library material copies. Note that it will need to be abstract in the LibraryMaterialCopy class MY CODE **************************************************************** LibraryCard: import java.util.List; import java.util.ArrayList; import java.time.LocalDate; import    java.time.temporal.ChronoUnit; public class LibraryCard {    private String id;    private String cardholderName;   ...

  • Create a class hierarchy to be used in a university setting. The classes are as follows:...

    Create a class hierarchy to be used in a university setting. The classes are as follows: The base class is Person. The class should have 3 data members: personID (integer), firstName(string), and lastName(string). The class should also have a static data member called nextID which is used to assign an ID number to each object created (personID). All data members must be private. Create the following member functions: o Accessor functions to allow access to first name and last name...

  • MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access...

    MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access a vector of structures, use sort with different compare functions. Assignment: Your program will use the same input file, but you will print the whole book information, not just the title. And, most importantly, this time you will take an object oriented approach to this problem. Detailed specifications: Define a class named Collection, in which you will define a structure that can hold book...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT