Skip to content

Chapter 1 Demo

David Zemon edited this page Feb 5, 2017 · 1 revision

Creation of a small application without Spring

This chapter contains a demonstration of the mess produced by dependency injection. We start with a basic "Hello World!" program and build a small application without Spring.

About

The demo will walk you through development of a simple program which which will create and spawn Pokemon on a map.

  • We will create the following POJOs
    • Pokemon will contain information about Pokemon (ID, HP, attack)
    • PokemonLocation will contain whereabouts for each Pokemon (x and y coordinates, Pokemon ID)
  • We will implement the following classes
    • RandomNumberGenerator will return a random integer value
    • PokemonFactory will use the RandomNumberGenerator to generate HP and attack values
    • PokemonDao will be used to store and retrieve Pokemon
    • PokemonLocationDao will be used to store and retrieve Pokemon location information
    • Gameboard will use the PokemonFactory and DAOs to spawn Pokemon at various locations

Clone this wiki locally