Click here to Skip to main content
15,889,507 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: color mixing riddle Pin
Philippe Mori17-Jun-12 2:50
Philippe Mori17-Jun-12 2:50 
AnswerRe: color mixing riddle Pin
Richard MacCutchan14-Jun-12 5:19
mveRichard MacCutchan14-Jun-12 5:19 
GeneralRe: color mixing riddle Pin
Kobi_Z14-Jun-12 7:16
Kobi_Z14-Jun-12 7:16 
GeneralRe: color mixing riddle Pin
Richard MacCutchan14-Jun-12 7:30
mveRichard MacCutchan14-Jun-12 7:30 
GeneralRe: color mixing riddle Pin
Kobi_Z14-Jun-12 8:07
Kobi_Z14-Jun-12 8:07 
GeneralRe: color mixing riddle Pin
Richard MacCutchan14-Jun-12 21:40
mveRichard MacCutchan14-Jun-12 21:40 
AnswerRe: color mixing riddle Pin
R. Giskard Reventlov14-Jun-12 9:46
R. Giskard Reventlov14-Jun-12 9:46 
QuestionGeneral App Design Questions Pin
Kevin Marois6-Jun-12 6:02
professionalKevin Marois6-Jun-12 6:02 
These questions are more about validating how I create apps. I know how I like to do things, but I'm curious how the rest of you do it, so feel free to critique or post suggestions.

I created a playground WPF app for tracking projects. The purpose of this app is primarily to play around and learn. In it I have UI, Entities, DAL, and BL projects. In the DB I created Company, Client, and Project tables. The Projects table has FK's for 3 lookup tables. See the pic here[^]

My project entity looks like this

public class ProjectEntity : _EntityBase
{
    public int ClientId { get; set; }
    public int ProjectTypeId { get; set; }
    public int ProjectStatusId { get; set; }
    public int PayTypeId { get; set; }
    public string ProjectName { get; set; }
    public DateTime? EstStartDate { get; set; }
    public DateTime? ActualStartDate { get; set; }
    public DateTime? EstEndDate { get; set; }
    public DateTime? ActualEndDate { get; set; }
    public bool? IsActive { get; set; }
    public decimal PayRate { get; set; }
}



Ok, now for the questions:

1) Would you have your entity objects maintain references to other entities, or just the PK? For example,
in the ProjectEntity I have ProjectTypeId which stores a reference to the Project Type row in lkpProjectTypes.

When I get a project entity, should I create and store a ProjectType entity on it, or just the PK?

What I usually do is store the PK of the lookup table, then call a method in the DL to get the lookup entity when
it's needed. But I could make the GetProject method in the DL create related object when its called. The
problem is that now you have a heavy object when you may not always need the child objects.

2) Similar to #1. When you create an instance of the ProjectEntity, would you create a ClientEntity and store it
on the ProjectEntity instance? If so, do you then go up the logical tree and create a CompanyEntity to store
on the ClientEntity which is stored on the ProjectEntity? Conversely, if you create a ClientEntity, do you store
a list of ProjectEntities on always? If all I want is to display the Client's name, then getting a fully loaded
ClientEntity seems like overkill.

3) How do you handle nulls, both in the DB and in the app? I'v heard some folks say never store nulls. I don't agree
with that, but I'd like to hear your thoughts.

Thanks
If it's not broken, fix it until it is

AnswerRe: General App Design Questions Pin
Eddy Vluggen6-Jun-12 7:04
professionalEddy Vluggen6-Jun-12 7:04 
AnswerRe: General App Design Questions Pin
jschell6-Jun-12 9:27
jschell6-Jun-12 9:27 
QuestionApplication Security Pin
Kevin Marois6-Jun-12 5:56
professionalKevin Marois6-Jun-12 5:56 
AnswerRe: Application Security Pin
Eddy Vluggen6-Jun-12 7:08
professionalEddy Vluggen6-Jun-12 7:08 
QuestionEncoding and decoding a text file Pin
Basavaraj Neelagund1-Jun-12 3:54
Basavaraj Neelagund1-Jun-12 3:54 
AnswerRe: Encoding and decoding a text file Pin
Richard MacCutchan1-Jun-12 6:26
mveRichard MacCutchan1-Jun-12 6:26 
AnswerRe: Encoding and decoding a text file Pin
jschell4-Jun-12 8:17
jschell4-Jun-12 8:17 
AnswerRe: Encoding and decoding a text file Pin
Albert Holguin4-Jun-12 8:39
professionalAlbert Holguin4-Jun-12 8:39 
AnswerRe: Encoding and decoding a text file Pin
R. Giskard Reventlov4-Jun-12 8:44
R. Giskard Reventlov4-Jun-12 8:44 
AnswerRe: Encoding and decoding a text file Pin
wizardzz5-Jun-12 7:30
wizardzz5-Jun-12 7:30 
GeneralRe: Encoding and decoding a text file Pin
Albert Holguin5-Jun-12 7:37
professionalAlbert Holguin5-Jun-12 7:37 
GeneralRe: Encoding and decoding a text file Pin
wizardzz5-Jun-12 7:39
wizardzz5-Jun-12 7:39 
GeneralRe: Encoding and decoding a text file Pin
Albert Holguin5-Jun-12 7:44
professionalAlbert Holguin5-Jun-12 7:44 
GeneralRe: Encoding and decoding a text file Pin
wizardzz5-Jun-12 7:44
wizardzz5-Jun-12 7:44 
QuestionWCF service based application design Pin
dan!sh 27-May-12 6:21
professional dan!sh 27-May-12 6:21 
AnswerRe: WCF service based application design Pin
Ed K6-Jun-12 3:47
Ed K6-Jun-12 3:47 
Question[algo] Algo for naming of duplicate/clone "objects" ? Pin
Maximilien25-May-12 9:19
Maximilien25-May-12 9:19 

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.