Click here to Skip to main content
15,888,610 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.

 
GeneralRe: DAO Framework Pin
User 48220337-Feb-12 0:57
User 48220337-Feb-12 0:57 
GeneralRe: DAO Framework Pin
TylerMc0077-Feb-12 8:22
TylerMc0077-Feb-12 8:22 
GeneralRe: DAO Framework Pin
Rob Grainger12-Feb-12 14:21
Rob Grainger12-Feb-12 14:21 
GeneralRe: DAO Framework Pin
cpkilekofp7-Feb-12 8:36
cpkilekofp7-Feb-12 8:36 
GeneralRe: DAO Framework Pin
ClockMeister7-Feb-12 13:11
professionalClockMeister7-Feb-12 13:11 
GeneralRe: DAO Framework Pin
HuntrCkr7-Feb-12 17:36
HuntrCkr7-Feb-12 17:36 
GeneralRe: DAO Framework Pin
Florin Jurcovici7-Feb-12 21:46
Florin Jurcovici7-Feb-12 21:46 
GeneralRe: DAO Framework Pin
CDP18027-Feb-12 23:41
CDP18027-Feb-12 23:41 
The problem with other people's solutions always is that they are other people's solutions. They usually solve their problems and never quite yours and they do it in a way that suited them best. That's why I usually don't like 'Design by Frankenstein' where your project ends up only being the glue code between every framework and library that could be found.

An example? In a project we needed access to an already existing database. Its design was certainly not the best, but we had no other choice than to use it as it was. Trying to use Hibernate for this was one big mistake. The mappings were correct, but Hibernate constantly was nagging us to improve the database's design and that we should do this and not do that. It took a few creative workarounds to find mappings that Hibernate could live with. I could have found better uses for the time that took than getting a 'smart' framework to do its job.

And let's not forget that (understandably) that each library or framework was designed to solve a very central and important task, so the designers thought a certain use of resources (like memory and the CPU) to be justified. The problem is that all the other frameworks were seen to be just as important by their designers and you can quickly end up with a slow memory hog.

Its hunger for memory was the reason why Hibernate was thrown out of the project. It quickly went through the roof (i.e the server process' memory limit) before even a medium size job was successfully done. Totally unacceptable in productive use when several such jobs could be running at the same time. The problem was the persistance feature of Hibernate, which hogged the memory and was not really needed there. Using a stateless session was impossible because it did not have some of the features we needed.

In the end we threw out the complete resource access layer and Hibernate with it and built a new one with simple ADO.Net queries. We slammed that thing together in two days and it's working without any issues since then and the memory consumption while processing the jobs now is a constant level line.

So, if you ask me, simply go for the most direct way you can and use shiny frameworks sparingly and only after thinking through all possible aspects.
I'm invincible, I can't be vinced



GeneralRe: DAO Framework Pin
BobJanova8-Feb-12 4:28
BobJanova8-Feb-12 4:28 
GeneralRe: DAO Framework Pin
CDP18028-Feb-12 7:58
CDP18028-Feb-12 7:58 
GeneralRe: DAO Framework Pin
BobJanova8-Feb-12 23:12
BobJanova8-Feb-12 23:12 
GeneralRe: DAO Framework Pin
CDP18029-Feb-12 0:36
CDP18029-Feb-12 0:36 
GeneralRe: DAO Framework Pin
BobJanova9-Feb-12 0:43
BobJanova9-Feb-12 0:43 
GeneralRe: DAO Framework Pin
CDP18029-Feb-12 1:55
CDP18029-Feb-12 1:55 
GeneralRe: DAO Framework Pin
Rob Grainger12-Feb-12 14:31
Rob Grainger12-Feb-12 14:31 
GeneralConnectivity test PinPopular
MatthysDT1-Feb-12 1:19
MatthysDT1-Feb-12 1:19 
GeneralRe: Connectivity test Pin
Albert Holguin1-Feb-12 3:25
professionalAlbert Holguin1-Feb-12 3:25 
GeneralRe: Connectivity test Pin
Ankit Maini1-Feb-12 20:42
Ankit Maini1-Feb-12 20:42 
GeneralRe: Connectivity test Pin
MatthysDT1-Feb-12 20:47
MatthysDT1-Feb-12 20:47 
GeneralRe: Connectivity test Pin
Dan Neely10-Feb-12 13:00
Dan Neely10-Feb-12 13:00 
GeneralRe: Connectivity test Pin
VallarasuS2-Feb-12 0:50
VallarasuS2-Feb-12 0:50 
GeneralRe: Connectivity test Pin
kmoorevs2-Feb-12 4:05
kmoorevs2-Feb-12 4:05 
GeneralRe: Connectivity test Pin
Gary Wheeler2-Feb-12 0:19
Gary Wheeler2-Feb-12 0:19 
GeneralRe: Connectivity test Pin
patbob2-Feb-12 6:13
patbob2-Feb-12 6:13 
GeneralRe: Connectivity test Pin
sergiogarcianinja2-Feb-12 2:12
sergiogarcianinja2-Feb-12 2:12 

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.