Skip to content

WIP Examples refactoring

Niklas Krieger requested to merge ExamplesRefactoring into master

Changes

  • Rename Example1 to Example01 and increase the number for all other examples
  • Remove GrainHamsters
  • Remove SimpleHamsterGame because extending a class with the same name is confusing and it fulfills basically no purpose
  • Rename Example01a to Example00
  • Add Example05 to demonstrate the usage of the TerritoryBuilder
  • Add for each example an ...App class which contains a main to start the example (this is also the way it is done later)
  • Rename Main to ExampleWithoutSimpleHamsterGame to make clear for what it is for and to show students that this is not the main entry point for examples
  • doRun on SimpleHamsterGame is now public because this is used as entry point when starting a SimpleHamsterGame from outside (e.g. the App class with the main method)

Breaking Changes

  • doRun on SimpleHamsterGame is now public

Other

The examples were mainly used as examples for slides. Therefore, one goal of this merge request was to not over complicate the examples so that they can be used as before. Especially, Example00 does not use javadoc and Example03 still demonstrates the conflict between local variables and member variables. I would recommend to also update the slides.

Open questions

  • Maybe export the examples? If we do that, the students could instantiate the examples and run them by themselves to see what they do.
  • Maybe add a few more complex examples (which also demonstrate good javadoc and jml) (any ideas)?

Merge request reports

Loading