http://qs321.pair.com?node_id=438479


in reply to reordering a stack with little effort

Leave out the question number as a property of the question. In OO terms, it is not related to the question, but to a collection of questions. Call that a questionaire or a quiz, I guess.

After Compline,
Zaxo

  • Comment on Re: reordering a stack with little effort

Replies are listed 'Best First'.
Re^2: reordering a stack with little effort
by Anonymous Monk on Mar 11, 2005 at 15:09 UTC
    That just depends on ones point of view. If you think it's important to have "global" information, use a "collection" and define the other there. But there's no need for global information - the entire sequence of questions can be retrieved by looking at the data locally: as long as each question knows its neighbour(s), the entire collection and its order can be retrieved as well.

    Of course, if you want to create multiple collections, you can't store the information locally as easily, as a question can belong to more than one collection.

    Having said that, even with collections, you haven't solved, or even side-stepped the problem. You will still have a sequence of numbers somewhere in a table that indicates the order in your collection - and you know have to insert a question.