Software Modeling

Asked

Viewed 64 times

0

A software that has the option of registering projects and that each project has its specific working days (working days), which by default is Monday to Friday, but can be changed by project managers.

The question is about the implementation of this relationship between each project and its useful days. I thought of creating several boolean attributes representing the days of the week marked with true or false whether they are working days or not. However, I find it very "hard code". What would be the best implementation for the situation? How to associate each project to its working days? inserir a descrição da imagem aqui

1 answer

0


In a way it may seem "hardcore" the idea of inserting 7 columns as boolean, but analysing the other possibilities as for example use only a column string or some numerical type to "decode" the information in your code (I don’t know if you ever thought of other possibilities for your case), would be more expensive than validating 7 boolean columns, is at first turn the best way to be treated in that case.

Using timestamp is also out of the question in this case, at first it is unnecessary.

Still reinforce the idea of keeping the 7 columns, because we are sure that the number of days in a week will not change (at least not easily).

Not to mention that you will already have the result in your application directly by Query, no need to do further analysis (required in other templates for this case)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.