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

Design and Architecture

 
GeneralRe: JSON size Pin
jschell1-Dec-17 7:52
jschell1-Dec-17 7:52 
GeneralRe: JSON size Pin
Gerry Schmitz1-Dec-17 8:22
mveGerry Schmitz1-Dec-17 8:22 
GeneralRe: JSON size Pin
jschell5-Dec-17 10:30
jschell5-Dec-17 10:30 
GeneralRe: JSON size Pin
Gerry Schmitz5-Dec-17 11:11
mveGerry Schmitz5-Dec-17 11:11 
AnswerRe: JSON size Pin
Eddy Vluggen1-Dec-17 0:50
professionalEddy Vluggen1-Dec-17 0:50 
AnswerRe: JSON size Pin
Nathan Minier1-Dec-17 1:38
professionalNathan Minier1-Dec-17 1:38 
AnswerRe: JSON size Pin
jschell1-Dec-17 7:56
jschell1-Dec-17 7:56 
QuestionDelima - User Enum or Allow User To Define Pin
Kevin Marois28-Nov-17 6:51
professionalKevin Marois28-Nov-17 6:51 
I have a WPF app. In it there are Companies. Companies can be of different types. For example, there are Builders, Lumber Companies, Electricians, etc. Some of the companies, like Builders, will be loaded into a Navigation bar on app startup. So I need to be able to query companies for those that are builders.

However, One thing I'd like to do is to allow the user to Add/Edit/Remove company types as they see fit. This presents a problem: How do you allow the user to maintain a lookup table of company types, yet in the code determine which are of a certain type?

One possibility is to use the following lookup table structure:
CREATE TABLE Lookups
(
    Id              INT NOT NULL IDENTITY PRIMARY KEY,
    Caption         VARCHAR(MAX) NOT NULL,
    Category        VARCHAR(MAX) NOT NULL,
    AppCode         VARCHAR(MAX) NULL,
    [Description]   VARCHAR(MAX),
    IsSystem        BIT
)

If a Company Type is required for the app to run, then set IsSystem to true and provide an AppCode like "company_type_builder".

This would allow me to query for companies that have their type set to that Lookup Id. The lookup types that are set as IsSystem cannot be removed by the user.

If I decide not to use a lookup table and make the company type fixed in code, then an enum would suffice.

What are your thoughts on this?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.


modified 28-Nov-17 12:57pm.

AnswerRe: Dilemma - User Enum or Allow User To Define Pin
Richard Deeming28-Nov-17 7:22
mveRichard Deeming28-Nov-17 7:22 
AnswerRe: Delima - User Enum or Allow User To Define Pin
Mycroft Holmes28-Nov-17 12:12
professionalMycroft Holmes28-Nov-17 12:12 
GeneralRe: Delima - User Enum or Allow User To Define Pin
Kevin Marois28-Nov-17 12:13
professionalKevin Marois28-Nov-17 12:13 
QuestionGeneral "design patterns" usage questions Pin
MikeTheFid13-Nov-17 12:39
MikeTheFid13-Nov-17 12:39 
AnswerRe: General "design patterns" usage questions Pin
Pete O'Hanlon13-Nov-17 19:55
mvePete O'Hanlon13-Nov-17 19:55 
AnswerRe: General "design patterns" usage questions Pin
Eddy Vluggen13-Nov-17 23:03
professionalEddy Vluggen13-Nov-17 23:03 
AnswerRe: General "design patterns" usage questions Pin
Gerry Schmitz14-Nov-17 4:14
mveGerry Schmitz14-Nov-17 4:14 
GeneralRe: General "design patterns" usage questions Pin
Eddy Vluggen14-Nov-17 5:12
professionalEddy Vluggen14-Nov-17 5:12 
GeneralRe: General "design patterns" usage questions Pin
Gerry Schmitz15-Nov-17 5:54
mveGerry Schmitz15-Nov-17 5:54 
GeneralRe: General "design patterns" usage questions Pin
Eddy Vluggen15-Nov-17 7:26
professionalEddy Vluggen15-Nov-17 7:26 
GeneralRe: General "design patterns" usage questions Pin
jschell15-Nov-17 7:43
jschell15-Nov-17 7:43 
GeneralRe: General "design patterns" usage questions Pin
Eddy Vluggen15-Nov-17 8:57
professionalEddy Vluggen15-Nov-17 8:57 
GeneralRe: General "design patterns" usage questions Pin
jschell16-Nov-17 11:18
jschell16-Nov-17 11:18 
GeneralRe: General "design patterns" usage questions Pin
Eddy Vluggen17-Nov-17 0:14
professionalEddy Vluggen17-Nov-17 0:14 
GeneralRe: General "design patterns" usage questions Pin
jschell17-Nov-17 12:02
jschell17-Nov-17 12:02 
JokeRe: General "design patterns" usage questions Pin
JustWatchLittle 20-Dec-17 5:46
professionalJustWatchLittle 20-Dec-17 5:46 
GeneralRe: General "design patterns" usage questions Pin
Gerry Schmitz20-Dec-17 5:51
mveGerry Schmitz20-Dec-17 5:51 

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.