Search code examples
datemodelingmdriven

Choosing between text, string, date, date/time (MDriven)


Which one of the following is preferably used when creating an attribute containing data on when something was established:

  • "String"
  • "Text"
  • "Date"
  • "Date/Time"

?

Researching, I found that both "String" and "Date" should be able to create "(YYYY-MM-DD)" equally well.

I also found earlier posts here on SO with titles like this one: How to convert date(string type) into date(date time ) in oracle

Obviously there's a point I've missed here. Surely there's a benefit for using one over the other.

(I'm working in MDriven)

Many thanks.


Solution

  • DateTime should be correct. You may also achieve this in MDriven by using a superclass that by inheritance gives all your objects a set of attributes for creation and change. This will give you "automatic" support, if you want the user to enter, then use an attribute with type "DateTime"