servlets - MVC Design - How many controllers? -
overview
i’m building simple web application consisting of canvas , elements on canvas.
the canvas supports following operations: load, save
the elements support following operations: move, resize
javascript on web page sends message server each operation , server sends appropriate response.
my design

note: arrow between canvas , element objects supposed denote canvas object contains list of element objects. didn't have right symbols diagram.
example work flow
- an element on canvas moved generating element_moved message.
- the front controller manages session , passes message canvas controller correct canvas object.
- the canvas controller inspects message , sees element on canvas , passes on element controller.
- the element controller parses message , updates appropriate element object directly.
question
is hierarchical arrangement of controllers common place in mvc designs or missing point? i've searched several hours haven't found sites discuss mvc design in more depth returning page view.
my motivation behind design each object client needs interact has controller if interface changes (to support new methods) corresponding controller can updated without impacting other parts of design.
usually won't have 1 controller calling in mvc. have specified element controller part of business logic update canvas model. if use case requires update elements independently of canvas, have separate element controller, calling business logic update element.
cheers, ryan
Comments
Post a Comment