Click here to Skip to main content
15,879,613 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralN-Tier architecture Pin
virang_2112-Mar-12 18:08
virang_2112-Mar-12 18:08 
GeneralRe: N-Tier architecture Pin
RobCroll12-Mar-12 18:42
RobCroll12-Mar-12 18:42 
GeneralRe: N-Tier architecture Pin
virang_2112-Mar-12 19:06
virang_2112-Mar-12 19:06 
JokeRe: N-Tier architecture Pin
Shameel14-Mar-12 2:03
professionalShameel14-Mar-12 2:03 
GeneralRe: N-Tier architecture Pin
StM0n12-Mar-12 19:09
StM0n12-Mar-12 19:09 
GeneralRe: N-Tier architecture Pin
CDP180212-Mar-12 21:58
CDP180212-Mar-12 21:58 
GeneralRe: N-Tier architecture Pin
krumia17-Mar-12 20:44
krumia17-Mar-12 20:44 
GeneralRe: N-Tier architecture Pin
CDP180218-Mar-12 0:40
CDP180218-Mar-12 0:40 
A good candidate for that would be the data object itself. Just to take another example than simple validation: Let's say we have the common case that we need to store a password, which should be salted and hashed for security reasons. Why not put the method to do that into the data object? This way it can be ensured that the salting and hashing is done every time the password field of the data object is set. And this method can also be called to hash the string entered during login and then compare it to the value stored in the data object.

This may be contrary to the dogma that data objects are supposed to be simple containers for the data only, but in object oriented design it makes sense when an object has methods or properties to validate its state or make changes to its state.
I'm invincible, I can't be vinced



GeneralRe: N-Tier architecture Pin
Stefan_Lang14-Mar-12 2:58
Stefan_Lang14-Mar-12 2:58 
GeneralRe: N-Tier architecture Pin
Nitin20TechBLR15-Mar-12 18:26
Nitin20TechBLR15-Mar-12 18:26 
GeneralMicrosoft "help" Pin
Alan Balkany7-Mar-12 8:28
Alan Balkany7-Mar-12 8:28 
GeneralRe: Microsoft "help" Pin
Stefan_Lang8-Mar-12 3:41
Stefan_Lang8-Mar-12 3:41 
GeneralRe: Microsoft "help" Pin
cruest13-Mar-12 3:23
cruest13-Mar-12 3:23 
GeneralRe: Microsoft "help" Pin
SASS_Shooter1-May-12 6:14
SASS_Shooter1-May-12 6:14 
GeneralRe: Microsoft "help" Pin
Nelek10-Mar-12 15:18
protectorNelek10-Mar-12 15:18 
GeneralRe: Microsoft "help" Pin
Gary Wheeler13-Mar-12 0:35
Gary Wheeler13-Mar-12 0:35 
GeneralRe: Microsoft "help" Pin
BrainiacV13-Mar-12 4:26
BrainiacV13-Mar-12 4:26 
GeneralRe: Microsoft "help" Pin
Fabio Franco13-Mar-12 6:42
professionalFabio Franco13-Mar-12 6:42 
GeneralRe: Microsoft "help" Pin
Nunnenkamp13-Mar-12 8:56
Nunnenkamp13-Mar-12 8:56 
GeneralRe: Microsoft "help" Pin
KP Lee13-Mar-12 12:01
KP Lee13-Mar-12 12:01 
GeneralRe: Microsoft "help" Pin
Jwalant Natvarlal Soneji13-Mar-12 18:03
Jwalant Natvarlal Soneji13-Mar-12 18:03 
GeneralRe: Microsoft "help" Pin
Reelix14-Mar-12 1:14
Reelix14-Mar-12 1:14 
GeneralRe: Microsoft "help" Pin
Lutosław15-Mar-12 11:49
Lutosław15-Mar-12 11:49 
GeneralUnsafe locking Pin
Member 20530061-Mar-12 5:02
Member 20530061-Mar-12 5:02 
GeneralRe: Unsafe locking Pin
PIEBALDconsult1-Mar-12 6:00
mvePIEBALDconsult1-Mar-12 6:00 

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.