• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Vacuum

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a strange architecture.. all of the changes occur and are written to a hash map, and then on a regular basis (as specified by a timer and on certain events (such as exit)) it re-writes the contents of the file. This enables me to "remove" records that were deleted - thus saving file space. My question is this, will I be penalized for having an architecture which is perceived as "too complex".
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, my buddy.

I have a strange architecture..



Honestly, this doesn't sound good, man.

My question is this, will I be penalized for having an architecture which is perceived as "too complex".



As far as I can tell, yes. This is on my assignment:

"A clear design, such as will be readily understood by junior programmers, will be preferred to a complex one, even if the complex one is a little more efficient. Code complexity, including nesting depth, argument passing, and the number of classes and interfaces, should be reasonable."

Try to make things easier to understand, and try not to make your assignment bigger than it is.
 
Sean Beecroft
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The fact that I said "Strange Architecture" is not a great way to start off.
I should have said that differently.

I found the code was too awkward and difficult to understand before. (I previously had the "simple" architecture). My new architecture is alot easier for me to read.

It basically has a hash map which is easy enough to understand, and then it has a routine which writes that to the file every once and a while.

That is probably a fairly common architecture for any database app. Re-writing the app at this point would be alot of extra work.
 
Sean Beecroft
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've gone ahead implementing my vacuum functionality.

Anyone think this is a bad idea?
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Sean,

I think it's a not so good idea (just like Roberto): it makes your code more complex then necesary. If your code was complex before, there's probably a better solution than this.
Also: al updates will be lost in case of a power break-down.

Does your instructions.html say anything about "removing records that were marked as deleted". If not: I would not implement it.

Herman
 
Sean Beecroft
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I already submitted my project. I will shout back here and let you know how it goes. Hopefully they won't penalize me.

With regards to saving on power failure:
It is true that it would lose data on a power failure.

I did not see any requirement to save in the event of power failure.
It saves just fine on normal shut down.

Theoretically any design could fail to write a record on a power failure.

The reason I did it was because it made it much easier to read.

Keep you updated on the results.
[ April 02, 2008: Message edited by: Sean Beecroft ]
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic