Click here to Skip to main content
15,890,741 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: In fear of bloated Statergy Pattern Implementations Pin
Eddy Vluggen22-Sep-15 23:27
professionalEddy Vluggen22-Sep-15 23:27 
SuggestionRe: In fear of bloated Statergy Pattern Implementations Pin
Richard Deeming23-Sep-15 1:49
mveRichard Deeming23-Sep-15 1:49 
AnswerRe: In fear of bloated Statergy Pattern Implementations Pin
jschell3-Oct-15 7:04
jschell3-Oct-15 7:04 
QuestionCan we configure team foundation server (TFS) on our local machine such as windows 7 or windows 8 Pin
Anjani Rajdev22-Sep-15 3:11
Anjani Rajdev22-Sep-15 3:11 
QuestionWindows 10 System Colors Pin
jung-kreidler11-Sep-15 1:52
jung-kreidler11-Sep-15 1:52 
QuestionSOLID Principles, Three Layers... Is this okey? Pin
MarkosElCojudo5-Sep-15 8:35
MarkosElCojudo5-Sep-15 8:35 
AnswerRe: SOLID Principles, Three Layers... Is this okey? Pin
Eddy Vluggen10-Sep-15 12:04
professionalEddy Vluggen10-Sep-15 12:04 
AnswerRe: SOLID Principles, Three Layers... Is this okey? Pin
Nathan Minier30-Sep-15 7:08
professionalNathan Minier30-Sep-15 7:08 
Really the key point of SOLID design is to properly abstract your objects. Signature and implementation should not be the same thing. There is a bit of code overhead involved, but when you find you need to scale an application you'll be grateful.

In that interest, generally you want to define interfaces and build your objects off of them. This way, if you need to add functionality later, you can build another interface to fulfill that requirement, add it to the appropriate objects, and act on that interface rather than on the objects themselves. This prevents changes from breaking functionality that worked before, and the spaghetti code that inevitably follows. Now, you can use an abstract class instead, but it's not as good a solution for exactly those reasons.That is also a large part of the point of the Interface Segregation principle, you can always add interfaces to a class and link functionality via those, rather than changing the current (working) signature. You can even add interfaces to interfaces if needs require.

The last principle, Dependency Inversion, carries the previous to its logical conclusion. Don't act on an object, act on an interface. If you need to cast something, cast it to an interface. No other class should care how an object performs a task, just that it performs it.

For instance, if I'm using a SQL server and want to switch to Mongo, my previous SqlRepository object will need to be swapped out in every place that I declared it in code with a MongoRepository. Even if I did a bulk REGEX replace on the name, potential second order effects are very likely. I might have a method or property in the SqlRepository that I didn't replicate, or that I didn't replicate with the exact same signature. This could easily break my application.

If instead I acted on IRepository, from which I implemented both SqlRepository and MongoRepository, I would not have to change any other thing in my application just because I swapped out the repository type, except, perhaps, the inject point. The interface would force me to match my signatures, and the expected input would generate the expected output. This way I add a class, change one single word in my dependency injection mechanism, and now my application uses a completely different data backend that is not even remotely compatible with the old one.

Now I know this isn't a bullet-point list of SOLID principles, but really that mnemonic is just a way to catalog all these ideas and hang a label on them. I hope it helps.

QuestionFast Name Matching Pin
RichardGrimmer2-Sep-15 2:13
RichardGrimmer2-Sep-15 2:13 
AnswerRe: Fast Name Matching Pin
Eddy Vluggen2-Sep-15 2:21
professionalEddy Vluggen2-Sep-15 2:21 
GeneralRe: Fast Name Matching Pin
RichardGrimmer2-Sep-15 2:26
RichardGrimmer2-Sep-15 2:26 
GeneralRe: Fast Name Matching Pin
Eddy Vluggen2-Sep-15 2:35
professionalEddy Vluggen2-Sep-15 2:35 
AnswerRe: Fast Name Matching Pin
Keld Ølykke9-Sep-15 13:22
Keld Ølykke9-Sep-15 13:22 
AnswerRe: Fast Name Matching Pin
Nathan Minier30-Sep-15 7:33
professionalNathan Minier30-Sep-15 7:33 
QuestionHow to do Responsive Web Design Testing? Pin
uistreet19-Aug-15 21:11
uistreet19-Aug-15 21:11 
QuestionIs it possible to apply CSS to half of a character/word? Pin
protekconsulting18-Aug-15 20:34
protekconsulting18-Aug-15 20:34 
AnswerRe: Is it possible to apply CSS to half of a character/word? Pin
Richard Andrew x6420-Aug-15 9:57
professionalRichard Andrew x6420-Aug-15 9:57 
AnswerRe: Is it possible to apply CSS to half of a character/word? Pin
SharmaSumit21-Aug-15 19:39
SharmaSumit21-Aug-15 19:39 
QuestionI need a ardinuo programming code for blood pressure sensor display using cuff Pin
Member 1187747412-Aug-15 21:33
Member 1187747412-Aug-15 21:33 
AnswerRe: I need a ardinuo programming code for blood pressure sensor display using cuff Pin
OriginalGriff12-Aug-15 21:34
mveOriginalGriff12-Aug-15 21:34 
QuestionShould I change from a multi-window to a single-window multi-page approach? (WPF, C#) Pin
Frank R. Haugen7-Aug-15 1:42
professionalFrank R. Haugen7-Aug-15 1:42 
AnswerRe: Should I change from a multi-window to a single-window multi-page approach? (WPF, C#) Pin
Eddy Vluggen7-Aug-15 2:10
professionalEddy Vluggen7-Aug-15 2:10 
GeneralRe: Should I change from a multi-window to a single-window multi-page approach? (WPF, C#) Pin
Frank R. Haugen7-Aug-15 2:25
professionalFrank R. Haugen7-Aug-15 2:25 
GeneralRe: Should I change from a multi-window to a single-window multi-page approach? (WPF, C#) Pin
Eddy Vluggen7-Aug-15 2:39
professionalEddy Vluggen7-Aug-15 2:39 
AnswerRe: Should I change from a multi-window to a single-window multi-page approach? (WPF, C#) Pin
mbb0110-Aug-15 4:34
mbb0110-Aug-15 4:34 

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.