Java With the projects appearing below, one of your tasks during design is to plan how to convert it from a console application to a GUI application Operation This application will present a user with five choices: list, add, delete, help, and exit. Menu choices may be used, but buttons are often used. If the user chooses “list”, the application displays the customer data that’s stored in a text or XML file for persistent storage. If the user chooses “add”, the application prompts the user to enter data for a customer and saves that data to the persistent storage. If the user chooses “delete”, the application prompts the user for an email address and deletes the corresponding customer from the persistent storage. If the user chooses “help”, the application displays the usage information. If the user chooses “exit”, the application displays a goodbye message and exits. Specifications Create a class named Customer that stores data for the user’s email address, first name, and last name. Create interfaces named CustomerReader and CustomerWriter that define the methods that will be used to read and write customer data to persistent storage In addition, create an interface named CustomerConstants that contains three constants that specify the display size of a customer’s email address (30), first name (15), and last name (15). Then, create an interface named CustomerDAO that inherits all three of these interfaces. Create at least one persistence class that implements the methods specified by the CustomerDAO interface. Store the customer data. If you use a text or XML file which doesn't exist, this class should create it. Create a class named DAOFactory that contains a method named getCustomerDAO.
This method should return an instance of the persistence class. Create a CustomerMaintApp class that controls execution. This class should use the DAOFactory class to get a CustomerDAO object. Then, it should use the methods of the CustomerDAO object to read customer data from and write customer data to the persistent storage. Use the Validator class or a variation of it to validate the user’s entries. Non-empty strings are required for the email address, first name, and last name. Use spaces to align the customer data in columns on the console. To do that, you can create a utility class named StringUtils with a method that adds the necessary spaces to a string to reach a specified length. Add an “update” command that lets the user update an existing customer. This command should prompt the user to enter the email address. Then, it should let the user update the first name or last name for the customer. Add a method to the Validator class that uses string parsing techniques to validate the email address. At the least, you can check to make sure that this string contains some text, followed by an @ sign, followed by some more text, followed by a period, followed by some more text. For example, .firstname.lastname@example.org” would be valid while “xxx” or “x@x” would not.
Get Free Quote!
374 Experts Online