• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Vacuum

 
Sean Beecroft
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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".
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
I've gone ahead implementing my vacuum functionality.

Anyone think this is a bad idea?
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic