The Artima Developer Community
Sponsored Link

Design Forum
design sanity check/advice

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Gary White

Posts: 1
Nickname: gdw
Registered: Jun, 2006

design sanity check/advice Posted: Jun 26, 2006 8:02 PM
Reply to this message Reply
Advertisement
I'm relatively new to "real" object-oriented design/development (i.e. patterns/refactoring etc.) although I've been working with OOP languages for quite some time. I've been doing a lot of reading/research in order to take it to the next level and am incorporating it into a new project I'm working.

The app is a survey engine developed using Java/Spring/Hibernate. Surveys contain pages which contain questions (different variations of multiple choice and essay-type). Surveys exist in 3 distinct phases: survey design, survey response entry and survey analysis/reporting. I've started out with a domain model which represents just the design phase of a survey lifecycle. The classes contain just the information which needs to be persisted to define the structure/layout of the components.

e.g.:

public class SurveyDefinition {

private Long id;
private String title;
private String description;
private List pages = new ArrayList();

public abstract class QuestionDefinition {
private Long id;
private Integer questionNumber;
private String prompt;
private boolean answerRequired;
private PageDefinition page;
.
.
.
}

public abstract class MultipleChoiceQuestionDef extends QuestionDefinition {

private boolean singleAnswer;
private List choices = new ArrayList();
.
.
.
}

This initial design was really just created to get my feet wet with Hibernate to make sure that I could get all of the ORM inheritance/polymorphism/association mechanisms working. I have kind of a vague idea of where I want to take this but I want to make sure that I’m not too far off base before I get too far into the design.

Does it make sense to have the survey design phase entities (e.g. SurveyDefinition, PageDefinition, QuestionDefinition etc.) as separate classes distinct from the survey response entry phase entities (e.g. Survey, Page, Question etc.)? I’m thinking that the survey response entry phase entities really are different animals with richer behavior and that these could be created by passing the definition entities into a factory/creation class/method.

Are there any (other) strategies/patterns etc. that I might want to pursue?

Any suggestions/advice/admonitions/coaching/counseling/encouragement and/or hot stock tips would be greatly appreciated.


Thanks,
Gary

Topic: Where does CORBA stand today? Previous Topic   Next Topic Topic: creational patterns

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use