Executive Summary
Draw It or Lose It is a web-based game service where players try to guess an object being drawn by the game. The service takes object images from a library of stock images and allows multiple games to be played simultaneously, each with one or more teams of at least one player.
Design Constraints
The service requires server software to manage multiple games, teams and players and ensure that their names and Ids are unique. This software should be written in Java.
The server will require significant internet connection speed and reliability to accommodate each individual player and ensure images are sent simultaneously and with minimal to all players. Similarly, the connection should ensure that player guesses are received with minimal delay.
The web-based client needs to be capable of working on all common browsers, both desktop and mobile.
The stock image database should be licensed and regularly updated with new images.
Domain Model
The program utilizes three main classes to implement elements of the game: Game, Team, and Player. Since these elements share common data on their Id and name, a superclass, Entity, is created to access this data. This uses the core object-oriented programming principle of inheritance and polymorphism, as instances of all three of these classes are entities, allowing other components to interact with them as such, rather than instances of their specific classes.
Each game maintains its list of teams, and each team stores its players in a list. This uses composition and encapsulation as data is assigned to objects only as it is necessary, and one object can contain instances of others.
The GameService class is the system’s overall manager, maintaining a list of games and enabling one to search through this list. As new games are requested, GameService creates new instances of the Game class and adds them to the list. Since only one instance of this class is ever needed, it should implement the Singleton pattern. If multiple instances were allowed, it would create confusion to which games are managed by each instance, allowing repeated names and Ids and making searching impossible.
To facilitate searching through the lists of games (and possibly teams and players as well, if necessary), GameService can make use of the Iterator pattern.
The ProgramDriver class is responsible for general running of the server application.
SingletonTester is used for testing purposes.
Evaluation
Recommendations
Operating Platform: based on the evaluation above, the choice of operating platform is between Windows and Linux. The crucial advantage of a Linux server is its ability to add new features or remove unnecessary ones as desired. With Windows, adding or removing features may be more difficult, and the system’s licensing fees may not be cost-effective. Furthermore, Linux is a generally more stable and secure platform. Thus, Linux is the preferred operating platform for Draw It or Lose It’s server.
Operating Systems Architectures: the Linux architecture consists of the system’s kernel, hardware layer, and application layer. For Draw It or Lose It, the kernel will likely be provided with the system and not require any modifications. The hardware layer hosts the machine’s storage and physical memory and will not require direct interaction once set up. Finally, the application layer will house the game’s server application, which will be responsible for memory and storage allocation and interfacing with clients.
Storage Management: for reliability, a RAID array should be employed on the server. This structure uses multiple hard drives to store the same data, creating a degree of redundancy. If one drive fails, the array can, depending on its exact implementation, store a “mirrored” copy of the same data, or reconstruct lost data through error-correction. RAID 5 is the most commonly used RAID system, offering both the benefits of improved performance and data resiliency at a minimum of operational overhead.
Memory Management: Linux uses virtual memory, ensuring that physical memory is accessible and treated as contiguous even in situations when it is not. This approach allows memory to be allocated to the server program as required by new games being created regardless of whether a contiguous segment is available. Similarly, during times of low load, memory can be reallocated to other system processes as necessary.
Distributed Systems and Networks: Draw It or Lose It’s proposed client-server architecture can be expanded into a distributed system to improve its reliability, accessibility, and speed. For instance, instead of relying on a single central server, multiple ones can be established in different regions so players can connect to one closer to them, ensuring a faster and more reliable connection. Furthermore, if one server becomes overloaded or experiences an outage, clients can be redirected to another to prevent interruptions in service. Furthermore, the image database can be stored at a separate host accessible by multiple servers or clients simultaneously, reducing the storage requirements of each individual machine. Finally, the user account database can be stored in another centralized host, so a copy of this data should not be kept on each individual server. This will also allow players to preserve their data across servers.
Security: as the game service will likely use username and password combinations to identify and authenticate users, these combinations are a security concern. Therefore, passwords should never be stored “as is” on servers, and must instead be encrypted. Furthermore, to prevent intrusion on servers, no unnecessary programs should ever be running on them and any changes to running programs should be reported. Similarly, the server’s security policy should ensure that access rights are only given to appropriate personnel, who must be properly authorized before they can make any changes.