wood burning stoves 2.0*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Algorithm visualization application - Design suggestions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Algorithm visualization application - Design suggestions" Watch "Algorithm visualization application - Design suggestions" New topic
Author

Algorithm visualization application - Design suggestions

Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

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


The quieter you are, the more you are able to hear.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Algorithm visualization application - Design suggestions
 
Similar Threads
Locking Schemes: Tactical View 01
Design 01
who uses algorithms they learned in cs classes?
Domain Objects with IDs
Using Unreferenced vs a daemon thread