Click here to Skip to main content
15,888,454 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Never use pure built in types Pin
Richard MacCutchan11-Dec-14 6:43
mveRichard MacCutchan11-Dec-14 6:43 
GeneralRe: Never use pure built in types Pin
D4rkTrick21-Dec-14 8:18
professionalD4rkTrick21-Dec-14 8:18 
AnswerRe: Never use pure built in types Pin
den2k8811-Dec-14 7:37
professionalden2k8811-Dec-14 7:37 
GeneralRe: Never use pure built in types Pin
jschell12-Dec-14 12:29
jschell12-Dec-14 12:29 
GeneralRe: Never use pure built in types Pin
den2k8814-Dec-14 0:09
professionalden2k8814-Dec-14 0:09 
GeneralRe: Never use pure built in types Pin
jschell16-Dec-14 12:37
jschell16-Dec-14 12:37 
AnswerRe: Never use pure built in types Pin
jschell12-Dec-14 12:26
jschell12-Dec-14 12:26 
GeneralRe: Never use pure built in types Pin
D4rkTrick21-Dec-14 8:17
professionalD4rkTrick21-Dec-14 8:17 
Hi,

jschell wrote:
Nope. Certainly can use "int ID" in a million lines of code and then expect to do nothing if you change it to "string ID".

that's true. But if you *have to* change it anyway. I'd say it's better this way, as you don't forget to change any places. And then you can see all the consequences at once, instead of forgetting something, that somehow manages itself to production code.

jschell wrote:

Throughout all of the code the data probably will not have the same meaning.

This sentence - taken as it is - would be a serious design problem that crashes in the long view.
But with your example, it gets clearer, what you mean Smile | :)

jschell wrote:

For example as a database designer I might need to store a time stamp in a database using two columns (seconds and nanos), the business logic uses a timestamp (single value) and the UI uses a formatted text value localized for the user.

In that case I'd have three different types (as you have in the code at the moment) - or one class, that supports every representation.

jschell wrote:

Normal sequential numerics in a database do not extend for the full binary range of something like an integer.

jschell wrote:

So I need a range check before that.

I guess you mean a range check in the DB, right?
I'd say, that it's rather dangerous to rely on the databases ranges and functionalities.

jschell wrote:

And I do NOT want to find out I have run out of ids in the database when the entire application fails because the id is too big

but what if you do?
then you need to search the whole application for every appearance or every function (even the generic ones, that might not be named well) and change/adjust the behaviour.
(You need to do in both versions, but - as above - the compiler will help you in one version, as it becomes a static error, not a runtime one)

jschell wrote:
it shouldn't allow one for Jan 1 1001.
so what to do if Jesus walks in because he's reawoken? "Sorry sir, you must be born after 1970 to get medical care" Big Grin | :-D

jschell wrote:

Been a few years since I worked in C++ but rather positive than I can do exactly that. Matter of fact it is easier to do it that way than the right way. And assignment still works so why would anyone be attempting to cast (per your example)?

sorry, I didn't really get this one.
You mean nobody would try to cast a second to a user-id, but many might cast int to uint?

If I sum everything up right, I'd say, that it's not a bad idea, but one needs to take care where to apply it. So not *every* type, but very important or technical types.
(@technical: is the English language lagging the difference between technical (like hardware, programming, "thread") and real-world stuff (like a "train"-class, that is not a technical, but rather a ??? type?)

jschell wrote:
Certainly can use "int ID" in a million lines of code and then expect to do nothing if you change it to "string ID".
this was btw. the reason for my idea/question, because that happend to me - although only some > 100.000 lines.
QuestionHow to avoid backend stored procedures Pin
nstk8-Dec-14 21:24
nstk8-Dec-14 21:24 
JokeRe: How to avoid backend stored procedures Pin
Brady Kelly12-Dec-14 5:52
Brady Kelly12-Dec-14 5:52 
AnswerRe: How to avoid backend stored procedures Pin
Eddy Vluggen12-Dec-14 7:27
professionalEddy Vluggen12-Dec-14 7:27 
AnswerRe: How to avoid backend stored procedures Pin
Dominic Burford23-Dec-14 1:35
professionalDominic Burford23-Dec-14 1:35 
QuestionRearchitecting BackgroundWorker based to Task based? Pin
Matt T Heffron17-Nov-14 12:49
professionalMatt T Heffron17-Nov-14 12:49 
AnswerRe: Rearchitecting BackgroundWorker based to Task based? Pin
Richard Deeming18-Nov-14 2:45
mveRichard Deeming18-Nov-14 2:45 
AnswerRe: Rearchitecting BackgroundWorker based to Task based? Pin
Gerry Schmitz18-Nov-14 7:00
mveGerry Schmitz18-Nov-14 7:00 
QuestionRemote Desktop Connection Pin
Non Sequitur11-Nov-14 3:43
Non Sequitur11-Nov-14 3:43 
SuggestionRe: Remote Desktop Connection Pin
ZurdoDev11-Nov-14 5:27
professionalZurdoDev11-Nov-14 5:27 
AnswerRe: Remote Desktop Connection Pin
Pete O'Hanlon11-Nov-14 5:57
mvePete O'Hanlon11-Nov-14 5:57 
QuestionWhat is an architect for? Pin
Member 448708318-Oct-14 10:19
Member 448708318-Oct-14 10:19 
JokeRe: What is an architect for? Pin
Vivi Chellappa18-Oct-14 18:43
professionalVivi Chellappa18-Oct-14 18:43 
AnswerRe: What is an architect for? Pin
kimpetwangi25-Oct-14 17:12
kimpetwangi25-Oct-14 17:12 
AnswerRe: What is an architect for? Pin
Richard MacCutchan18-Oct-14 21:22
mveRichard MacCutchan18-Oct-14 21:22 
GeneralRe: What is an architect for? Pin
Member 448708318-Oct-14 21:59
Member 448708318-Oct-14 21:59 
GeneralRe: What is an architect for? Pin
Richard MacCutchan18-Oct-14 22:08
mveRichard MacCutchan18-Oct-14 22:08 
AnswerRe: What is an architect for? Pin
Eddy Vluggen19-Oct-14 3:50
professionalEddy Vluggen19-Oct-14 3:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.