World Appl Design Summary -------------------------- Entity classes -------------- class City { int id; initial value = 1 min = 1 max = Integer.MAX Rules: the id must be greater than zero String name; initial value = "unknown" min length = 1 max length = 35 Rules: the name must not be null, or empty the name must not contain any XSS attacks (JavaScript tags) String countryCode; initial value = "USA" fixed length = 3 Rules: the countryCode must not be null, or empty the countryCode must not contain any XSS attacks (JavaScript tags) the countryCode must be converted to uppercase String district; initial value = null min length = 1 (if not null) max length = 30 Rules: the district may null or empty the district must not contain any XSS attacks (JavaScript tags) int population; initial value = 1 min = 1 max = Integer.MAX Rules: the population must be greater than zero } class Country { String code; initial value = "USA" fixed length = 3 Rules: the code must not be null, or empty the code must not contain any XSS attacks (JavaScript tags) the code must be converted to uppercase String name; initial value = "unknown" min length = 1 max length = 52 Rules: the name must not be null, or empty the name must not contain any XSS attacks (JavaScript tags) String continent; initial value = null min length = 1 (if not null) max length = 15 Rules: the continent may be null, but not empty the continent must not contain any XSS attacks (JavaScript tags) String region; initial value = "unknown" min length = 1 max length = 26 Rules: the region must not be null, or empty the region must not contain any XSS attacks (JavaScript tags) double surfaceArea = 1.00 min = 1.00 max = Double.MAX Rules: the surfaceArea must be 1.00 or greater int independenceYear = 1900 fixed length = 4 Rules: the independenceYear must be a 4 digit year the independenceYear must be the current year or earlier int population; initial value = 1 min = 1 max = Integer.MAX Rules: the population must be greater than zero double lifeExpectancy = 1.0 min = 1.0 max = 999.9 Rules: the lifeExpectancy must be greater than zero double gnp = 1.00 min = 1.00 max = 9999999999.99 Rules: the gnp must be greater than zero String localName; initial value = null min length = 1 (if not null) max length = 45 Rules: the localName may be null, but not empty the localName must not contain any XSS attacks (JavaScript tags) String govermentForm; initial value = null min length = 1 (if not null) max length = 45 Rules: the govermentForm may be null, but not empty the govermentForm must not contain any XSS attacks (JavaScript tags) int capital; initial value = 1 min = 1 max = Integer.MAX Rules: the capital must be greater than zero String code2; initial value = "US" fixed length = 2 Rules: the code2 must not be null, or empty the code2 must not contain any XSS attacks (JavaScript tags) the code2 must be converted to uppercase List languagesForThisCountry Rule: languagesForThisCountry cannot be null languagesForThisCountry must have at least 1 language } class Continent { Enum code; initial value = "NA" fixed length = 2 Rules: the code must not be null the code must be in ("NA", "SA", "AF", "AS", "EU", "OC", "AN") Enum name; initial value = "North Americia" min length = 1 max length = 15 Rules: the name must not be null the name must be in ('Asia','Europe','North America','Africa' 'Oceania','Antarctica','South America') String highestPoint; initial value = "unknown" min length = 1 max length = 20 Rules: the highestPoint must not be null, or empty the highestPoint must not contain any XSS attacks (JavaScript tags) int highestElevation; initial value = 1 min = 1 max = Integer.MAX Rules: the highestElevation must be greater than zero String lowestPoint; initial value = "unknown" min length = 1 max length = 20 Rules: the lowestPoint must not be null, or empty the lowestPoint must not contain any XSS attacks (JavaScript tags) int lowestElevation; initial value = 0 min = Integer.MIN max = Integer.MAX Rules: double surfaceArea = 1.00 min = 1.00 max = Double.MAX Rules: the surfaceArea must be 1.00 or greater } class Organization { String code; initial value = "UN" fixed length = 7 Rules: the code must not be null, or empty the code must not contain any XSS attacks (JavaScript tags) the code must be converted to uppercase String name; initial value = "United Nations" min length = 1 max length = 50 Rules: the name must not be null, or empty the name must not contain any XSS attacks (JavaScript tags) int yearFounded = 1945 fixed length = 4 Rules: the yearFounded must be a 4 digit year the yearFounded must be the current year or earlier } class CountryLanguage { String countryCode; initial value = "USA" fixed length = 3 Rules: the code must not be null, or empty the code must not contain any XSS attacks (JavaScript tags) the code must be converted to uppercase String name; initial value = "unknown" min length = 1 max length = 30 Rules: the name must not be null, or empty the name must not contain any XSS attacks (JavaScript tags) boolean official; initial value = false double percentage = 1.00 min = 1.00 max = Double.MAX Rules: the percentage must be 1.00 or greater the percentage must be 100.00 or less } Action classes ----------------- CityDAO List findAllCities() List findCitiesByCountry(Country country) List findCitiesByCountry(String countryCode) City findCityById(int id) void addCity(City city) void updateCity(City city) void deleteCity(City city) void deleteCity(int id) CountryDAO List findAllCountries() Country findCountryById(String code) List findCountriesByContintent(Continent continent) List findCountriesByContintent(String continentCode) List findCountriesByLanguage(CountryLanguage language) List findCountriesByLanguage(CountryLanguage language, boolean isOffical) List findCountriesByOrganization(Organization organization) List findCountriesByOrganization(String organizationCode) void addCountry(Country country) void updateCountry(Country country) void deleteCountry(Country country) void deleteCountry(String code) ContinentDAO List findAllContinents() Continent findContinentById(String code) Continent findContinentByName(String name) void updateContinent(Countinent continent) OrganizationDAO List findAllOrganizations() Organization find OrganizationById(String code) List findOrganizationsByCountry(Country country) List findOrganizationsByCountry(String countryCode) List findOrganizationsByYearFounded(int year) void addOrganization(Organization organization) void updateOrganization(Organization organization) void deleteOrganization(Organization organization)