Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I'm not sure where to start. </p> </blockquote> <p>We always start with the data model.</p> <blockquote> <p>having never worked with databases before, how to I incorporate these items into the models and test units?</p> </blockquote> <p>Ah, well, there's the problem.</p> <p>You have to start with the data, because everything starts with the data.</p> <ol> <li><p>Write use cases. Your 5 technical requirements aren't really very good use cases because there's no Actor who interacts with a system. You need to write down the things an actor does -- what the actor interacts with.</p></li> <li><p>Identify the objects that the actor interacts with. When in doubt, write down all the nouns in your use cases.</p></li> <li><p>Draw a picture of the classes that will implement those objects.</p></li> <li><p>Walk through your use cases to be sure that all the things an Actor needs to do are based on attributes of your class definitions. All the data an actor needs has to be in these classes, which will become tables in your database.</p></li> </ol> <p>Now, you have to start doing more technical work. You need a web framework with an ORM layer. You're using PHP, so you'll have to find a good framework for this. Cake or Doctrine or something.</p> <ol> <li><p>Define one class in your ORM layer. You don't have to be complete or precise, you just need something that you can test with.</p></li> <li><p>Write unit tests for this class to be sure that it has the right data elements. This will be relatively simple at first, since your individual data classes will start out simple.</p></li> </ol> <p>Once the basic set of classes are defined, you'll need to look at relationships among classes. This is where the real work starts.</p> <ol> <li><p>Look at a relationship in your picture. Any line. Pick one randomly.</p></li> <li><p>Write unit tests to be sure that you can "navigate" across that line. From one object, fetch the related objects at the other end of the line. This shouldn't be very complex, just a few lines of code. </p></li> <li><p>Create a "fixture" -- test data you can load into a database -- to represent the objects and their relationships.</p></li> <li><p>Run the test. If it breaks, update your ORM definitions to support the navigation properly.</p></li> </ol> <p>When you've finished doing all the various relationships, you will have built a reasonable complete data model in a Test-Driven manner.</p> <p>Now you can build your PHP presentation for the model objects. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload