Click here to Skip to main content
15,892,161 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Information Relation Modeling Pin
Gerry Schmitz3-Mar-15 13:30
mveGerry Schmitz3-Mar-15 13:30 
GeneralRe: Information Relation Modeling Pin
Daniel Lieberwirth (BrainInBlack)4-Mar-15 2:02
professionalDaniel Lieberwirth (BrainInBlack)4-Mar-15 2:02 
GeneralRe: Information Relation Modeling Pin
Gerry Schmitz4-Mar-15 23:27
mveGerry Schmitz4-Mar-15 23:27 
GeneralRe: Information Relation Modeling Pin
Daniel Lieberwirth (BrainInBlack)5-Mar-15 2:28
professionalDaniel Lieberwirth (BrainInBlack)5-Mar-15 2:28 
NewsRe: Information Relation Modeling Pin
Daniel Lieberwirth (BrainInBlack)7-Mar-15 4:34
professionalDaniel Lieberwirth (BrainInBlack)7-Mar-15 4:34 
QuestionPrimaryKey-Generation-Strategy in n-Tier Pin
manchanx25-Feb-15 7:21
professionalmanchanx25-Feb-15 7:21 
AnswerRe: PrimaryKey-Generation-Strategy in n-Tier Pin
Wendelius25-Feb-15 7:57
mentorWendelius25-Feb-15 7:57 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx25-Feb-15 21:24
professionalmanchanx25-Feb-15 21:24 
Thank you for your response Mika!
Mika Wendelius wrote:
In all cases I'd always let the database generate the surrogate key value, never the DAL layer.
What I meant is that the client sends a request for key-provision to the DAL which then lets the database generate it through sequences.

<small>Mycroft Holmes</small> wrote:
Listen to Mika, let the database generate the primary keys, you may need to submit in sequence so you get the PK to be used as a foreign key on the children.
The application for which I will use the framework I'm designing here first has a use case where usually about 1000 entities plus sub-entities are created. I don't want to make that many remote calls for performance reasons.

Mika Wendelius wrote:
If the referential information isn't seen from the object hierarchy and you need a value for foreign keys until they are actually created
Yes, I need some value for foreign keys - object references are "virtual" through keys, to facilitate lazy instantiation and cache expiration/GC. Not sure if I'm missing something but I see some problems with the HashCode approach: In contrast to Guids, HashCode-collisions are much more likely. On top of that they could collide with pre-existing keys. A deterministic generation of temporary keys would appear safer to me - but I would like to avoid that altogether.

- Sebastian

edit: typo

modified 26-Feb-15 4:03am.

GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
jschell26-Feb-15 9:45
jschell26-Feb-15 9:45 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx26-Feb-15 20:20
professionalmanchanx26-Feb-15 20:20 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
jschell27-Feb-15 10:19
jschell27-Feb-15 10:19 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx27-Feb-15 20:00
professionalmanchanx27-Feb-15 20:00 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
jschell4-Mar-15 9:00
jschell4-Mar-15 9:00 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx5-Mar-15 3:13
professionalmanchanx5-Mar-15 3:13 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
jschell6-Mar-15 10:52
jschell6-Mar-15 10:52 
AnswerRe: PrimaryKey-Generation-Strategy in n-Tier Pin
Mycroft Holmes25-Feb-15 13:21
professionalMycroft Holmes25-Feb-15 13:21 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx25-Feb-15 21:25
professionalmanchanx25-Feb-15 21:25 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
Mycroft Holmes25-Feb-15 21:49
professionalMycroft Holmes25-Feb-15 21:49 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx25-Feb-15 22:18
professionalmanchanx25-Feb-15 22:18 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
Pete O'Hanlon25-Feb-15 23:07
mvePete O'Hanlon25-Feb-15 23:07 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx26-Feb-15 0:06
professionalmanchanx26-Feb-15 0:06 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
Pete O'Hanlon26-Feb-15 0:17
mvePete O'Hanlon26-Feb-15 0:17 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx26-Feb-15 1:04
professionalmanchanx26-Feb-15 1:04 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
Pete O'Hanlon26-Feb-15 1:10
mvePete O'Hanlon26-Feb-15 1:10 
GeneralRe: PrimaryKey-Generation-Strategy in n-Tier Pin
manchanx26-Feb-15 1:23
professionalmanchanx26-Feb-15 1:23 

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.