I am building a survey tool that allows users to answer / edit their
answer / review the answer / analyse the results of a question.  The
problem I have is that the actual behaviour in each of these scenarios
may differ depending on the type of question (i.e. analysing a select
single option question will show a bar graph whereas the same action
for a short answer question will show all of the answers).

Currently I have a view component for each of the tasks (answer /
edit, review, analyse) and this component looks up another component
based on the question type to do the actual rendering.  This second
component is currently implemented as a view component and I simply
initialise it from the Render method of the first component and then
call Render on the second component.

While this allows me to create the illusion of a polymorphic view
component, it feels somewhat clunky and I am wondering if the view
component is the best place to make these kind of decisions.  Being
new to MonoRail and working on my own means discussions at the
whiteboard are a little one-sided so...

... am I on the right track here or is there a better approach that
will
1.  Allow me to alter the way a question is rendered based on the
question type
2.  Allow me to add question types without having to alter code (i.e.
follow OCP).

Comments, thoughts, pointers to other posts much appreciated (I'm sure
this is a common requirement but I must be looking in the wrong
places / using the wrong search terms as I haven't found anything of
use yet)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to