34
Views
8
Comments
Data Modeling  with the diferents entities ?

Hello,


I want to create a pizza ordering system.


I am having trouble modeling the data so that it is saved correctly in the database and presented to the user.


I have in mind a "pizza" record with:


1. flavor


2. small size price


3. medium size price.


4. price for large size.


Do I need to create three entities: one with flavor, one with size and one with value?


thanks

jacky joy

mvp_badge
MVP

If you want to be able to change the flavours in the future (that is, add a new flavour, or remove an unpopular flavour), you definitely need an Entity for that.

Since the sizes seem pretty fixed, I'd create a Static Entity with those three records.

And then you can go two ways: you could create an Entity that, for each combination of flavour and size, has the price, or you could just have a single record with three Attributes, for each size, containing the price.

Also note that your datamodel should probably be more elaborate, depending on your needs. You would probably have a list of ingredients, and store all the ingredients per flavour. And you should be able to tell, per flavour, whether it's a vegatarian or vegan pizza, and you should probably also be able to tell what allergenes are in which ingredient/flavour.

Then you might want to allow customization, like remove one ingredient and add another (and subtract / add costs per ingredient).

And apart from different sizes, you may have different crust types (American style, Italian style), different preperations (pan pizza, oven pizza) and so on and so forth.

The sky is the limit :).

mvp_badge
MVP

this exact same question is asked months ago. Is this a question from some training?

mvp_badge
MVP

Isn’t it from one of the masterclasses delivered by OutSystems MVP Rafael Pereira? I think I have seen it pass on my LinkedIn feed.

mvp_badge
MVP

Part of the training could then be to first search the forum for the answer.

Champion

Hahaha! Yes Daniel, Indeed. I agree with you. 

HI, yes is for Master Class of Rafael Pereira (RafaOutsystems), one of the exercises is create the Pizza Order Systems. (I make this master class and do this exercises to).


About your question how to create the data modeling use the Static Entity to sizes, and Entity for flavors. Like you say create another to connect flavor, size and save the price for that. 

Champion

Jacky, here is the old conversion on the same topic in forum. Please have a look - https://www.outsystems.com/forums/discussion/70137/data-modeling-with-diferents-entities/ 

mvp_badge
MVP

A bit weird that someone's in a class to learn OutSystems, then when they don't understand something ask the community instead of the teacher...

Anyway, I think the topic has been answered by now, I'm going to close it.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.