• 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

Algorithm visualization application - Design suggestions

 
Bartender
Posts: 825
5
Python Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello to all Ranchers!

It's been a while since I have created a new topic here. Now I would like to hear some advices about the following, though I must point out that I would prefer this to be more of a design than the implementation discussion.
I am about to start working on a Swing based application. The goal is to develop one able to visualise algorithm execution. To simplify, I am now focusing on sorting algorithms, and let's suppose that algorithms are operating on numeric values that are displayed as bars of height depending on their value. Also let's say that values are stored in some simple datastructure (ArrayList). These assumptions are made for the simplicity of discussion.

The main concern I'm having is how to properly divide responsibilities among different parts, and these include: datastructure(s), algorithm(s) implementation and component able to visualize what's happening with the first at each step of algorithm execution. Another goal I'm having is to make the application as modular as possible, so all those parts should be loosely coupled, developed as separate libraries/component that can be reused outside of this particular application is necessary.

The first idea that came to my mind is to exploit the benefits of the Observer pattern, where particular datastructure that algorithm is operating on is notifying component each time a change is made, so that component can display it in its new state. This possible solution gives some benefits (like simplicity of implementation), but it also has some disadvantages. These are the first that come to my mind: Datastructures implementation will be "soiled" with some additional code that maybe should not be there; What if algorithm is operating on a large set of data (say few thousand numbers), then re-displaying a whole structure might not be very effective.

I hope to hear opinion about the first idea, or some further suggestions.

Cheers!
Kemal
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic