Hi,
I'm trying to make a project more MVC oriented, I could use some pointers
...
The program is a java standalone desktop app to draw interactive hot spots
on top of a static background (a map).
THE MODEL:
it consists of my own Map object (a geographical map), which encapsultates
all its dynamic data: hot spot coords, labels coords, categories, etc.
THE VIEW:
It's a graphic component that draws the MODEL's data on top of the
background. It consists of a custom MapCanvas object, which has the
following methods groups:
- methods to draw stuff
- utility methods to compute graphic stuff (translations, rotations,
scaling, etc)
- user action methods (mouseclick, if this mode, then do that)
- also contains its own state (mode, scale, current selection, etc)

My goal is to break down the MapCanvas, which is a big hairy beast. My
problem is that the different groups of methods rely heavily on each other,
and on the canvas state. So, it's really difficult to cut out slices of the
pizza without getting those long mozarella strings.
For example, if I move the utility methods out, they need to constantly
refer to the MapCanvas' state through the creation of lots of new getter
methods, so it doesn't seem to bring any benefits. And then they are needed
by the MapCanvas to do its painting job.
I tried to make a CONTROLLER but it turned out to be trivial: I only had 3
'action methods' to put there (called by 3 mouse event listeners in the
MapCanvas). I left the actions themselves in the MapCanvas, cause they
totally rely on the canvas' state, and they need the util methods to do flow
control.

Cutting out the drawing methods doesn't really make sense, since this is
conceptually a canvas.

I would really appreciate some thoughts and advice. Thanks,

mig


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/NhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


_______________________________________________
MVC-Programmers mailing list
[EMAIL PROTECTED]
http://www.netbean.net/mailman/listinfo/mvc-programmers

Reply via email to