• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Production and Distribution Network - Student Project  RSS feed

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

I got this assignment from a company. I am trying to get student internship.

So the assignment is bellow as well as my suggestion for UML. I would like for someone to analyse it, possibly to tell me other ideas, mistakes I made or some other useful tips.

Also I would like to point out that I do understand idea of patterns such as Strategy, Observer Patter and MVC (in the sense of as much as a second year student can understand after reading few chapters from Head First design patterns).

Project require Singleton Pattern, does that mean that only Company object need to be created in that way or maybe all of the object? Are there any recommended material so that beginners may learn how to apply Singleton in a given situation?

I'm not sure how to "enable communication" between Factroy, Shipment and Sales Place? Do I have to do that through some classes methods that will be inside UI package (that is view part of MVC)? What is the best way to keep references to other objects?

I would like to use Interfaces in this project, how to achieve that in the sense to use interfaces so I can get my design better and more flexible? Maybe to for interacting with writing to files and creating object from string (from a file)...I hope I passed what I want to achieve..
______________________________________________________________________________________________________________________________________________________________________________________

Intro:
Make a simulation of production and sales network of electronic devices by respecting basic principles of object oriented programming. Aim of this assignment for the applicant is to show solid knowledge of object oriented programming and it is desirable to show usage of architectural and design patterns. It is not essential that application is working.

Note:
1. No date base should be used
2. No need to write html/css cod
3. Emphasis is on OOP
4. Try to implement following concepts in appropriate places:
-inheritance
-abstract classes
-polymorphism
-singeleton pattern

Assignment:

Factories keep their records on production and distribution of products in sales places. During production, each product is assigned unique serial number. Sales places can submit requests for delivering required products to the headquarter, by stating products and their amount. There are more factories and sales places within company, where sales places are sending requests to the company headquarter, and each factory may deliver products to any sales place.

Create a simulation script which does the following:

1. Create a company
2. Create factory “El Facto 1” within company
3. Create sales place “Super Tronics” within company
4. Create an employee in factory, Mark Johnson, roll: production worker
5.  Create an employee in factory, Mary Peterson, roll: production supervisor. This employee is superior to Mark Johnson
6. Create an employee in factory, Tim Green, roll: transport supervisor
7. Create an employee in factory, Mike Trenton, roll: seller
8. Create 20 monitors in factory “El Facto 1”, under supervision of Mary Peterson
9. Send request from sales place “Super Tronics” for delivering 10 monitors and 50 keyboards
10. Transport 10 monitors and 30 keyboards from factory “El Facto 1” to sales place “Super Tronics”, under supervision of Tim Green
11. Create a buyer Michael Grey
12. Michael buys a monitor from “Super Tronics” for the price of 80eur, pays in cash, from the seller Mike Trenton


Add logging of actions in the system. Actions needs to be logged in a .txt file(s) in the following format [date and time] [action] [additional information]
Possible example of one line from log file:
[20.03.2016 11:30] Transport, products: 10 x keyboard, 15 x mouse, from: El Facto 1, to: Super Tronics, supervisor Tim Green

Actions which need to be logged:
1. Production of every product individually (serial number, tip of product, factory in which product was made, date and time, name of supervisor)
2. Delivery requests (sales place which submits the request, list of products with amounts)
3. Products transport (factory name, name of destination – that is sales place, list of products with amounts, supervisor name)
4. Each sale (list of serial numbers, sales place, name of the employee who made a sale, means of payment ( cash/credit card), name of the buyer (if it is payed by credit card)





Thanks you ranchers

Vivify-uml.jpg
[Thumbnail for Vivify-uml.jpg]
 
Ranch Hand
Posts: 59
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only case where I would use a singleton pattern in this assignment is to have a single FactorySimulation object or something similar.

Also, in your diagram, everything inherits from ID, why?
 
Marshal
Posts: 64166
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to have a good choice of classes, but I can see some problems:-
  • Spell it role (or rôle) not roll, and paid not payed.
  • Don't simply write Method. List the methods with symbols like +-%$, parameter and return types
  • Your arrows look wrong. Using that sort of arrow suggests the different classes inherit from one another, which I am sure isn't what you want
  • I am not convinced about your cardinalities. You have 1...1 and 0...* on the same arrow. Does that mean you are going to send in an order with no items?
  • I can't remember whether you are supposed to write absract or use some other formatting convention.
  • I think your UML diagram needs a lot more work before you should consider handing it in.
     
    Campbell Ritchie
    Marshal
    Posts: 64166
    215
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Why are you using Maps to record factories?
     
    Miljan Puletic
    Ranch Hand
    Posts: 31
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Campbell Ritchie wrote:Spell it role (or rôle) not roll, and paid not payed.



    Sorry for my english spelling

    Campbell Ritchie wrote:Don't simply write Method. List the methods with symbols like +-%$, parameter and return types



    I think it is not super important for UML to be completely accurate, as long as cardinalities and choice of classes is good.

    Campbell Ritchie wrote:Your arrows look wrong.



    I was just following Gliffy online uml tool which I uesd for the diagram. On lectures, we were shown Power Designer, and used it rule on cardinalities. Factory may have 0 or infinity products, but a Product must belong to only one Factory, so cardinalities are set on opposite sides.

    Campbell Ritchie wrote:Why are you using Maps to record factories?



    A friend suggested to have a HashMap because latter it will be easier to write date to db.

    I changed it to HashSet. But i think it as well be a ArrayList?

    If some one can answer on questions asked on the beginning it would be greate Thank you all for answers
     
    Campbell Ritchie
    Marshal
    Posts: 64166
    215
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Miljan Puletic wrote:. . . I think it is not super important for UML to be completely accurate . . .

    If you hand that UML in, you won't get the internship. At student level, people will not require 100% accuracy, but a submission for an internship or a job must look complete.

    I was just following Gliffy online uml tool which I uesd for the diagram. . . . . Factory may have 0 or infinity products, but a Product must belong to only one Factory . . .

    The arrows are wrong. They represent inheritance.
    How is a factory going to have either 0 products or ∞ products? Why isn't the product cardinality 1...n? Why does a product belong to only one factory? I can't see that in the specification you gave initially.

    A friend suggested to have a HashMap because latter it will be easier to write date to db.

    I changed it to HashSet. But i think it as well be a ArrayList?

    You need to know what those data structures represent and how they work. If you are asked why you used a particular data structure, you will have to give a sensible answer.

    If some one can answer on questions asked on the beginning it would be greate

    The programming is straightforward, because the assignment gives so much details of what is required. You need to design classes to match the specification you havve been given. We don't give out such details.

    Thank you all for answers

    That's a pleasure
     
    Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
    Create Edit Print & Convert PDF Using Free API with Java
    https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!