Agree. The product should know its description, number, price, etc., but there should be a stock class which can list how many products there are.Liutauras Vilda wrote:I am not entirely sure it is Product's responsibility to know how many of themselves are left. . . .
Kees deVries wrote:So, if I understand this correctly, it should be something like: Order has a list of orderLines. orderline has has 1 product,
product has stockline,and stockline has stock/warehouse.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Have you tried to draw an UML class diagram? That would help for yourself to see the structure of classes and their relations. You could draw one and share it.Kees deVries wrote:Im trying to keep it as simple as possible. I have No table class, No customer class, No bill. So the only thing i Will have to add is a Stock line. Or Stock? The main confusing part for me is that when you create a new order object, it only has a orderID and tableNR. And order line has amount ... wait Let me explain More clear. How do i get the product into the order? Since it has to to from product all the way to order.
That suggests that Order HAS-A product/-s, for which is needed some kind of data structure to hold more than one of those and a method to add a product at any time in case customer wants a dessert after the main meal.How do i get the product into the order?
Kees deVries wrote:Im trying to keep it as simple as possible. I have No table class, No customer class, No bill.
So the only thing i Will have to add is a Stock line. Or Stock?
The main confusing part for me is that when you create a new order object, it only has a orderID and tableNR.
And order line has amount ... wait Let me explain More clear. How do i get the product into the order? Since it has to to from product all the way to order.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Kees deVries wrote:I'm not getting the Menu part, cannot I just keep a list like in the diagram ?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Kees deVries wrote:So, in this case, what is the difference between the menu class and the product class, and where does menu fit within the diagram?
(I reckon the menu class isn't in the database either?)
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Kees deVries wrote:Alright, yes i'm having some problems keeping database and Java apart.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Were you given some description about the whole system where you could find some hints on design, or you were given such diagram (you showed earlier) and need to implement it as it is?Kees deVries wrote:So, instead of the restaurantService holding a list of products, the service holds a menu. with a set of products that the restaurant has?
Kees deVries wrote:So, instead of the restaurantService holding a list of products, the service holds a menu. with a set of products that the restaurant has?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Kees deVries wrote:Thing is, i Made this up my self. And school approved it. But during my visits at school they stripped a lot like the table and bill classes cause that would Make it to difficult as a beginner. Trying to make it as simple as possible
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
There are worse crimes than burning books. One of them is not reading them. Ray Bradbury
One remark. I'd think other way round. Restaurant Services have/receive orders, which have table numbers written on them. Tables don't provide services, so they cannot have orders - they can know what they have ordered though.Kees deVries wrote:All tables have orders, even when there's no one sitting at the table.
Liutauras Vilda wrote:
One remark. I'd think other way round. Restaurant Services have/receive orders, which have table numbers written on them. Tables don't provide services, so they cannot have orders - they can know what they have ordered though.Kees deVries wrote:All tables have orders, even when there's no one sitting at the table.
Kees deVries wrote:Alright, So, what I want the RestaurantService(And most of the application) to do Is the following:
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|