ashish sharma

Greenhorn
+ Follow
since Apr 11, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ashish sharma

Hi

I am trying to make a small issue tracker to for learning JSP/
Servelets. I am trying to follow MVC architecture for the same and I
am stuck in a design issue with model classes.


Here is the scene....


There is a entity "IssueAtribute", which represents elements in a
Issue. (Basically entity "Issue" contains a Ordered List of
"IssueAttributes").


Now "IssueAttribute" can be of various types eg. TextIssueAttribute,
LongTextIssueAttribute, DateIssueAttribute, etc. The "View" in the MVC
will probably use this information to render the issue attribute. eg.
A JSP might create a Calendar widget for DateIssueType and TextArea
for LongTextIssueType etc.


So the design decision that i am struck with is how design class
hierarchy for "IssueAttribute" and its types. I considered using
inheritance for all its types as that way I can keep all
"IssueAttributes" in "Issue" as a single ArrayList but that will loose
its type information unless is do a check at runtime (using
instanceOf) which i think is in elegant.


So any idea/criticism is most welcome. Is there a Design Pattern that already covers this?


Thanks
Hi

I am trying to make a small issue tracker to for learning JSP/
Servelets. I am trying to follow MVC architecture for the same and I
am stuck in a design issue with model classes.


Here is the scene....


There is a entity "IssueAtribute", which represents elements in a
Issue. (Basically entity "Issue" contains a Ordered List of
"IssueAttributes").


Now "IssueAttribute" can be of various types eg. TextIssueAttribute,
LongTextIssueAttribute, DateIssueAttribute, etc. The "View" in the MVC
will probably use this information to render the issue attribute. eg.
A JSP might create a Calendar widget for DateIssueType and TextArea
for LongTextIssueType etc.


So the design decision that i am struck with is how design class
hierarchy for "IssueAttribute" and its types. I considered using
inheritance for all its types as that way I can keep all
"IssueAttributes" in "Issue" as a single ArrayList but that will loose
its type information unless is do a check at runtime (using
instanceOf) which i think is in elegant.


So any idea/criticism is most welcome.


Thanks
16 years ago