[fpc-pascal] Primitive Record Wrappers

Mazola Winstrol mazofeifer at gmail.com
Thu Feb 18 15:43:05 CET 2016


Em 18/02/2016 10:12, "Marco van de Voort" <marcov at stack.nl> escreveu:
>
> In our previous episode, Mazola Winstrol said:
> >    end;
> >
> >
> > Suppose that this class represent data of the Person table in a sql
> > database. Suppose that there is records where the column "BirthDate" is
> > null. How do i represent a null "BirthDate" in my object?
>
> Keep using variants instead of typed data.
>

I think this is not a good alternative. As the variant are untyped, should
the consumers of the person class assume that BirthDate are filled as a
formated date string '01/01/1980' or as a native tdatetime?

I think it would be better using record wrappers to primitive types. See
http://blogs.embarcadero.com/abauer/2008/09/18/38869.

What do you think about that?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160218/1eb41326/attachment.html>


More information about the fpc-pascal mailing list