Design and Implementation of a Graph-based Game
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Design and Implementation of a Graph-based Game

  • 506 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
506
On Slideshare
499
From Embeds
7
Number of Embeds
2

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 7

http://www.lmodules.com 6
http://www.linkedin.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Design and Implementation of a Graph-based Game [MAIAR API] Frank Appiah appiahnsiahfrank@gmail.comABSTRACT are some good benefits which P2P offers in the main archi-Many problems are naturally modelled using graphs and di- tecture of P2P systems. In order to share resources, peersgraphs, and data structures implementing the graph or the in Maiar interact directly with each through the exchangedigraph ADT are commonly used throughout computer sci- of messages. Peers directly access and exchange the shareence. Besides the network applications, graphs and digraphs resources they utilize in without a centralized service. Inserve as natural models for a host of other applications and Figure 1, a peer is a basically a Maiar Game Player withthis motivation lead us use it to model the world map of the shared resources with other peers and the server is a repre-Maiar Game. Graph played an important role in defining the sentation of a virtual peer for cross subnet communicationnotion of our world map. This paper discusses the interest of over the internet. A framework called shoal1 based on theexplicit software process models for (1) process understand- technology, JXTA [8] used in the design of our Peer-to-Peering and communication, (2) process reuse, and improvement. Game System has the notion that for cross subnet commu-The considered architecture include asynchronous commu- nication like the internet there need to exist a virtual list ofnication mechanisms, which are modeled in the Java-based hosts which will be used to route all messages to other peersMaiar API and achieved by message exchanges. over the internet. In order to achieve that we introduce a peer called Server which is logically another peer with the same shared resource as the other peers, Maiar Player-Peer.Categories and Subject Descriptors The Server is a Web Server precisely Tomcat [16] and thisH.4 [Software]: Distributed Systems will enable the application to continue working once Tomcat; D.2.8 [Software Ecosystems]: API development—Java is up and running. Figure 1 shows the details of our peer- to-peer network setup scenario.General Terms The rest of paper is organized as follows: In Section 2, weDesign, Graph Theory will discuss the formal notion of a graph, defintions and a brief background necessary for our work. Section 3 gives the graph representation of our game world, the overall overviewKeywords of the Maiar API with detail explanation of the 5 compo-XML; P2P; XML Parsing; Domain Object Models; nents. An introductory material and the design principles of each of the major 5 components are provided. The archi-1. INTRODUCTION tecture of Maiar will be accessed on how it provides someCurrently there is a new and highly interesting paradigm for major software quality attributes in Section 4. Finally, Sec-communication on the internet, known as P2P. Peer-to-Peer tion 6 concludes this paper.(P2P) is simply a system with a completely decentralizedself-organization and resource usage. P2P mechanisms canbe used to access any kind of distributed resources and mayoffer any new internet-based applications mostly in the area 2. MODEL AND BACKGROUND We model our distributed system as an asynchronous message-of gaming [14]. This model offers adequate formal basis to passing system without a shared memory or a global clock.deal with the reliable design of distributed system. It has be- Furthermore, at application level, a process at any processorcome important that for internet-based applications, issues (peer) may send message to any other processor. Graph [1]of scalability, performance, security, flexibility and quality played an important role in defining the notion of our worldof service needs to be taken care of. These requirements map. The topology of our world map can be viewed as undi- rected graph in which vertices (nodes) represent the rooms and the edges represent the playable movements between nodes. We will introduce some formal notions of graph. 1 Shoal is a java based scalable dynamic clustering framework that provides infrastructure to build fault tolerance, reliabil- ity and availability. The framework can be plugged into any product needing clustering and related distributed systems capabilities without tightly binding to a specific communi- cations infrastructure. https://shoal.dev.java.net/.
  • 2. Figure 1: Peer-to-Peer communication model. Definition 1. A graph G= (V, E) is a set V= V(G) callednodes(vertices), together with a set E= E(G) called egdes,such that an edge is an unordered pair of vertices. Figure 2: A Logical View of the Maiar Architecture.A edge {e, e} is called a loop. All nodes in the world graphare mapped to vertices in G. The edge set E contains all the game’s functionality is realized using Apache Maven [10].communication links between two nodes, each uniquely iden- Figure 2 depicts the logical layer of the Maiar Architecturetified by an assigned integer. Each processor keeps a local and Figure 3 shows the components and connectors of thestate of the distributed cache. When a message is being Maiar API.received, it’s added to the appropriate history and the mes-sage adapters notify the listeners of a change in state. Thesnapshot is cloneable, serializable and thus can be loaded 3.1 World Representation In this section, we will have a look at our algorithm for thefrom the local processor’s disk at runtime. According to [5], XMLtoObject parser and the structure of our XML [3], [15]recording the entire message history makes the application document.unscalable so we choose to record messages of relevant typeand content. The distributed cache is assumed to have infi-nite buffer and to be error-free. 3.1.1 XML Structure of the World.A distributed cache is a tuple of (CH , LH , NH , FH , UH , The xml structure of the world is defined with a DTD schema.CAH ) where CH is the chatHistory, LH is the locationHis- The elements used in the representation of the World are astory, NH is the newUserHistory, FH is the fightHistory, UH follows:is the userLocationHistory and CAH is the cacheUpdateHis- map: The map element is the root element of the worldtory. Despite our approach, [5] proposed three algorithms representation. It contains a rooms element and a globalwith different characteristics that make them much more element. The rooms element contains room-specific com-scalable. Their algorithm is based on grid, tree and central- mands, where the global element contains globally availableized models. We will not exhaust the differences of these commands.algorithms here so see paper for much details. <!ELEMENT map (exit|global|rooms|entry)*> Definition 2. A distributed program consists of a set of N <!ATTLIST mapprocesses denoted by P= {P1 , P2 , P3 ,....,PN } and a set of name CDATA #IMPLIED>unidirectional channels.The set of processes in the application is P= {cacheUpdate, rooms: The rooms element acts as a container for a seriesChat, Location, NewUser, Fight}. A process p ∈ P is a of room elements.thread-callback behavior that receives notification of mes-sages and updates state of the recipient peer’s distributedcache ,and deliver message to the onStateChange method <!ELEMENT rooms (room)*>of all registered listeners. An event [4] is a detectable con- <!ELEMENT room (commands| directions| itemsdition that can trigger a notification. A notification is an | look| intro)*>event-triggered signal sent to a run-time–defined recipient. <!ATTLIST room id CDATA #IMPLIED name CDATA #IMPLIED>3. THE MAIAR ARCHITECTUREIn this section, we will start with the representation of worldand discussion of the major components of the Maiar API intro: The intro element has a message attribute that holdswith concise reasons of choice of technology. The API is a short description of the room which appears whenever acomprised of a number of components, specialized for a spe- player moves into that room.cific purpose. Layers and domain objects are applied to thedesign of Angels and Demons game to introduce a clear iden-tification and modular separation of all baseline architecture <!ELEMENT intro EMPTY>elements in both their responsibilities and core usage rela- <!ATTLIST introtionships. As such vertical and horizontal decomposition of message CDATA #IMPLIED>
  • 3. look: The look element contains a more detailed description fraction: The fraction value is used when a response de-of the room in its description attribute. This description is pends on the player’s fraction. The value attribute can beused when a player enters the look command in a room. any string as long as it is used consistently in other com- mands. This is the case in inventory, activeQuests and fin- ishedQuests, where values that correspond to fraction should<!ELEMENT look EMPTY> be one of angel or demon.<!ATTLIST look satisfied: The satisfied element holds an action element description CDATA #IMPLIED> which is accessed when the condition in the parent require- ment element is satisfied.items: The items element is a container for item elements. notSatisfied: On the other hand, the notSatisfied element contains an action which is accessed when the parent re- quirement element’s condition is not satisfied.<!ELEMENT items (item)*> effect: The effect element is the most important part of<!ELEMENT item EMPTY> the commands, because they are the means of changing the<!ATTLIST item player state, and progressing the game. Each effect has two name CDATA #IMPLIED> attributes and an optional third one. The first two are sim- ilar to the requirement attributes, one being the parameterdirections: The directions element contains at most four attribute and the second being the value attribute. The pa-special elements, each for each direction an exit is available. rameter attribute can be the same value as the parameternorth/south/east/west: These direction elements each attribute in requirement except fraction which cannot be al-have an attribute roomId which contains an integer showing tered in the course of the game. Also an additional valuewhich room is connected in that direction. to the parameter attribute is introduced, the output value, which outputs a string to the game console. Also a param- eter value room is introduced which changes the location of<!ELEMENT directions (north|south|west|east)*> the player. Its values can be either north, south, east or west.<!ELEMENT east EMPTY> The values of the value attribute can again be any string<!ATTLIST east keeping in mind that there should be consistency in the def- roomId CDATA #IMPLIED> initions. The parameter output and room are the only ones<!ELEMENT west EMPTY> which do not need the third attribute which is operator. The<!ATTLIST west operator attribute can be either + or – where + adds the roomId CDATA #IMPLIED> value ( inventory[i].add(IEffect) ) to the corresponding view<!ELEMENT south EMPTY> of the player and – removes ( inventory[i].remove(IEffect) )<!ATTLIST south it where i is the ith element of inventory list, inventory[i]. roomId CDATA #IMPLIED><!ELEMENT north EMPTY> <!ELEMENT commands (command)*><!ATTLIST north <!ELEMENT command (action)*> roomId CDATA #IMPLIED> <!ATTLIST command name CDATA #IMPLIED>commands: The commands element, contains a list of com- <!ELEMENT action (requirement|effect)*>mand elements, representing the commands which are avail- <!ELEMENT effect EMPTY>able in the room. <!ATTLIST effectcommand: Each command element represents a command operator CDATA #IMPLIEDwhich is available in the room. It has a name attribute value CDATA #IMPLIEDwhich shows what string maps to the effects of that com- parameter CDATA #IMPLIED>mand. Each command element must contain exactly oneaction element. <!ELEMENT requirement (notSatisfied|satisfied)*>action: An action element, can be one of two types. It can <!ATTLIST requirementeither hold a requirement element or a list of effect elements. value CDATA #IMPLIEDThe action element can be thought of as a binary tree ele- parameter CDATA #IMPLIED>ment. An action which contains a requirement element can <!ELEMENT satisfied (action)*>be seen as a tree element, while an action containing a list <!ELEMENT notSatisfied (action)*>of effect elements can be seen as a leaf element.requirement: The requirement element is a element which <!ELEMENT global (commands)*>contains a satisfied and a notSatisfied element. It also has <!ELEMENT exit EMPTY>two attributes, the first being the parameter attribute and <!ATTLIST exitthe second being the value attribute. id CDATA #IMPLIEDThe parameter attribute can be one of the following: room CDATA #IMPLIED>inventory: This is used when the existence of an item inthe inventory is required. 3.1.2 Parsing the XML to the world graph.activeQuests: This is used when there needs to be a check In order of the world to be used during runtime it neededon whether a quest is currently active. to be converted into an Object. The chosen object type forfinishedQuests: This is used where a check on whether a the parsing was a graph of rooms for the room representa-quest has been finished. tion and a map of commands for the global commands. For
  • 4. parsing the XML, the use of the Jdom library has proven tobe the best choice because of the tree form of the XML fileit offers, and the access methods to the XML file. First theXML is read using a SAX builder, which parses the XMLto a tree. Then each room is parsed on its own using thegetChildren command which returns a list of the chosen el-ement type. Algorithm 1. XMLtoObject ParserInput: filename, path to the XML file. Figure 3: Component Architecture of MaiarOutput: roomGraph, graph representation of the XML.Begin the effect element. Set the created instance 1. Initialize roomGraph = empty and roomMap = XML- to an instance of Action class, rootAction. Tree document to hold the data extracted from the end if XML file located at filename. end for else 2. for all room element in the root element of roomMap Extract the parameter and value attributes of document do the requirement element. Set the attributes to a new instance of the requirement class. (a) Get the room name and id attributes. Set them Set the created requirement to the rootAc- as id and name to an instance of a Room class, tion. myRoom. Get the child satisfied and notsatisfied ele- (b) Add id as a node to roomGraph. ments of the requirement element. Parse the satisfied and notsatisfied elements using the (c) Get the intro child element of the room element parseAction subprocedure described above. and set the extracted message attribute to my- Set the actions from the satisfied and notsat- Room. isfied elements parsed to the rootAction as (d) Get the look child element of the room element trueAction and falseAction respectively. and set the extracted description attribute to my- end if Room. end for (e) for all extracted item element from the room el- iii. Set the command name and rootAction are ement do added to the room instance, myRoom. i. Get the name attribute and set it as an item (h) Get the node from the roomGraph by the id and to myRoom. end for set the myRoom to the node as the weight. (f) for all direction element extracted from the child end for of room element do i. Get name and roomId attribute of the ele- End ment and set them as a direction to the my- Room. ii. Add id and roomId attribute as an edge to roomGraph. end for 3.2 Model Component Since the game revolves around commands and states of the (g) for all command element extracted from the child world, its engine required a way to handle each command of room element do and send a response to it which must become visible to the i. Get the command name attribute and as- player. For this functionality a number of classes are used signed it as a key to the command map. to represent the game entities which are extracted from the ii. Get the child action element and parsed ac- world XML. These classes are a 1-1 mapping of the XML tion as the subprocedure, parseAction follows: elements with specialized effects, and additional remote ef- Get the child requirement of the action ele- fects which are a way of indirect communication with the ment: message service. if (requirement == null) then The main class of the game engine, the player includes all Get the effect elements. other classes mentioned and handles interactions between for all (effect element extracted) do them, and is responsible for communicating with other com- Get the parameter attribute of effect as ef- ponents of the game. It’s connected to other components us- fectType. Let EffectTypes= {output, Inven- ing a request-response protocol, where any component which tory, roomActivequests, Finishquests, Gamefin- needs to communicate with the game engine, must send its ish} input and wait for a response output, and handle the out- if (effectType ∈ EffectTypes) then put. The player interface is the only means of changing the Create an instance of the particular effect- state of the player and the only way of verifying if a com- Type with a value from the value attribute of mand is valid. It is a full representation of the game world
  • 5. as seen in a client, since the player class holds the player’s Sending Messages. Messages are sent through the JX-details, the room in which he or she is, the entire game map TAConnection class using the send method. Messages areas a graph, the player state (inventory, active and finished formed according to the commands the player enters, andquests, health points, and list of players with whom he or are broadcast on the group. When a message has a limitedshe is fighting), as well as a map to the global commands scope, that message is discarded on reception if the receivingand their actions, as they are extracted from the XML. client is not a member of that scope. Receiving Messages. When a message is received, if its3.3 Messaging Component scope includes the receiving client, it is added to the appro-One of the most important aspects of communication be- priate history in the local cache and the message listenerstween clients, is the broadcasting and reception of messages. are notified of an update of the local cache. Each receivingThrough messaging, the clients, update their local world client then processes the message and responds to it eitherstates, and represent the states of other clients. by representing it or sending a message of its own depending on the nature of the message.3.3.1 Design PrinciplesThe publish-subscribe architecture pattern describes an ab- 3.3.2 Message Typesstract mechanism for loosely coupled, many-to-many com- The types of messages are separated into state changing mes-munications between publishers of messages and subscribers sages and player communication messages. State changingwho wish to receive messages [6]. The messaging component messages are Location messages, New User messages andcan accept any number of listeners and when a message is Cache Update messages.being received all of the listeners are being notified of this Location messages: The Location messages are sent whenchange and they can act upon the state change. The advan- a client moves to a different room, so that the other clientstage of using this model is that we can add different com- update the state of the user locations they are using. Theyponents which can manipulate messages at any time just by include the User name of the client, the Room in which thehaving them subscribe to the message publisher. Also this client is moving and the fraction of the user (whether angelseparates the message component from the client component or demon). When a location message is received by a client,which enables the possibility of replacing the implementa- that client updates the User Location class which it holds,tion of the message component with a different one with- and if the rooms affected affect the receiving client (eitherout changing the subscribers. For the actual broadcast of the room the player left from or the room the player entersmessages there were several choices of technology including is the room in which the receiving client is currently in) aJGroups [7] and Jxta. room representation update follows.All the messages are an extension of the AbstractMessage New User messages: A New User message is sent whenclass, where a sender and a message string are defined, as a new user joins the game, sending an update of his name,well as a date and the message type. The AbstractMessage location and fraction for the other users to represent in theirclass is an abstract implementation of IGMessage interface local caches. The New User messages are processed differ-as defined below: ently depending on whether the client is a group leader or not. A new user has to get an update on the users who are already in the game, and so needs to get an updated dis-public interface IGMessage extends Serializable tributed cache. When a client receives a new user message,{ it updates the user locations it keeps on its local cache, al-public String getSender(); though if the receiving client is the group leader, it pushespublic void setSender(String sender); an updated instance of the local user locations to the dis-public String getMessage(); tributed cache, and sends a Cache update message to thepublic void setMessage(String message); new user to pull it.public void setDate(Date date);public Date getDate(); Cache Update messages: The cache update messages arepublic String getType(); messages that are sent when one or more players need to pull} the distributed cache to get an updated view of the world. These messages are sent by the group leader to clients whoEach type of message extends this class by adding any ad- don’t have an updated view. When a client receives such aditional information it may require. Specifically, Location message, it must pull the distributed cache from the groupmessages add the room id of the players location as well handler and save it in its local cache. Player communica-as the player’s fraction. Chat messages add a scope and tion messages are separated into combat messages and chatthe receiving room id and/or player, cache update messages messages. Fight messages include the Fight messages andadd a recipient who should update his or her cache. Chat the Damage messages.messages are extended by fight messages which are a specialtype of chat messages and use a specific message string for Fight messages: Fight messages are sent when a playercommunication, and damage messages are a special type of initiates a fight with another player or when a player hasfight messages which introduce a damage amount integer. received a fight challenge message. To start a fight, a playerTo achieve this, several types of messages are used, each one sends a fight challenge message to the target client. When asent when the appropriate effect is triggered, and are pro- player receives such a message, it sends a Fight acceptedcessed accordingly. There is also a distributed and a local message to the sending client which initializes the fight.cache used for sharing the user states that need to be shared. When the client that sent the challenge receives an accep-
  • 6. tance, the fight begins for it also. When a player’s life totalreaches zero during a fight, then a fight death message issent to all the players with which the player was fighting,and a fight reward message is sent to the first player whoinitiated the fight. When a client receives a death messagefrom another player, it stops fighting that player, and whena reward message is received, that player adds the rewardto its inventory.Damage message: Damage messages are the backbone ofcombat. When a fight is initiated, all participating playerssend damage messages to the other players with whom theyare fighting, over a two second interval. A damage mes-sage contains the receiving and sending user names, and the Figure 4: The life cycle of a local command.damage amount which is an integer less than or equal to9. When a player receives a damage message, it subtractsthat damage amount from its life total. The other form of GUI.communication messages are chat messages:Chat messages: Chat messages are the means of social 3.4 Logging Componentcommunication between players. They are separated into Maiar Logging provides a facility for maintaining the devel-three scopes. The global scope is sent when a player uses opment of the game in the development stage and for cus-the shout command. The room scope is sent when a player tomers at production stage. Basically, the logging facilityuses the say command and the personal scope is used when provides these core functionalities:a player uses the whisper command. The global chat mes-sages are represented in all clients, while the room messagesare represented only by players who are in the same room Developer Diagnosis: The most obvious functional meritas the sender, and personal messages are represented by the of logging is to help developers under developmentplayer set as a recipient, if that player is in the same room stages to be able to debug the application. Becauseas the sender. a modular approach was used in designing the game, it is essential that each module is able to log its activ-All these types of messages are saved as a history in the local ities to help us to identify other problems that occurcache of each player. This cache contains a chat history, at runtime and other low-level libraries were used ina new user history, a cache update history, and a location the implementation, logs help locate problems in themessage history. The local cache communicates with the application.player by using the State changed event listeners and thestate changed events. Whenever a change occurs in the local End-Users and System Administrator Diagnosis: It iscache, the client is notified of the source of that change and important that messages sent by a peer are transmit-can manipulate the messages which were received by reading ted successfully to the group, which is the core build-them from the local cache. ing block of our design. End-users can use logging activities in the application to convey the errors in the application to the System Administrators for system3.3.3 Communication Engine diagnosis. In practice, common end-user needed logsThe engine component (model) communicates with other include system failure, memory issues and errors in thecomponents using a request - response architecture through configuration files. With the Maiar Logging, these logsits interface. That interface is the player class interface are generated and can be configured to send email towhich offers methods for retrieving trivial data from the the Maiar development team.player class, and two methods which can result in game statechanges. These methods are the tryAction method, and theExternalEffect method, both of which return a list of effects 3.4.1 Design Principlesto be handled and represented to the GUI. The main dif- There are a lot of logging frameworks out there, which eachference between them is that the tryAction method takes as has different core functionality. The idea of designing Maiarinput a String command which is the player input command Logging over the other frameworks inclusively SlF4J [13],after it’s been parsed by the command parser, while the Ex- Log4j [9] and JDK logging requires a common interface toternalEffect method takes as input a RemoteEffect, which is abstract the implementations of the frameworks from oura type of effect which involves multiplayer interaction and is implementation. The Logging compound component showsinvoked by an incoming effect. In Figure 4, the internal life the three basic factory components each of which providescycle of operational activities of state is depicted and Fig- an access to a particular logging frameworks. The use of theure 5 shows the life cycle of the remote interaction between abstract factory design pattern separates the details of theGUI of peers. This architecture ensures that the engine implementation of a set of objects from their general usage.component can work independently of either a multi player The basic details of the factories are:component or a GUI component, and can be used in a dif-ferent type of game, which could have a different GUI andno multi player mode with just slight modifications. This InternalLoggerFactory: This creates an InternalLoggeralso allows asynchronous communication with other players which changes the default factory implementation. Thissince the messaging engine works asynchronously from the factory allows you to choose what logging framework
  • 7. Figure 5: The life cycle of a remote command. Authorization : Authenticated users and applications have defined access rights to the resources of the system. For ex- ample, some users may have read-only access to the appli- cation’s data, while others have readwrite. Encryption : The messages sent to/from the application are encrypted. Integrity : This ensures the contents of a message are not altered in transit. Non-repudiation : The sender of a message has proof of delivery and the receiver is assured of the sender’s identity. Figure 6: Screenshot of the Maiar Client. This means neither can subsequently refute their participa- tion in the message exchange. Maiar should use. The default factory is JdkLogger- Our architecture only supports authentication but the other Factory. You can change it to your preferred logging three security-related requirements can be provided. New framework before other Maiar classes are loaded. Each users to the system first create an account by registering factory implementation only uses the newInstance method. their details and choosing user name and password. This information is stored in the database. Whenever users wishJdkLoggerFactory: This factory class extends the Inter- to play the game, they would supply user name and pass- nalLoggerFactory which uses the java.util.logging.Logger word and is checked against the one in the database, MySQL to provide the new instance of the ILogger class by [11]. If the information provided matches with the informa- passing the instance of java.util.logging.Logger to the tion in the database, access is immediately granted. This JdkLogger class. The ILogger class provides access to ensures that no unauthorised user ever gets access to the basic logging functionality like debug messages, warn system. messages , info messages and error messages.Sl4jLoggerFactory: This factory class extends the Inter- 4. SOFTWARE QUALITY ATTRIBUTES nalLoggerFactory which uses the org.sl4j.Logger to pro- This section provides an overview of the software quality at- vide the new instance of the ILogger class by passing tributes that our application attains much to do with the the instance of org.sl4j.Logger to the Slf4Logger class. choice of the technology. Quality attribute requirements are ILogger interface provides the same functionality as part of an application’s nonfunctional requirements, which that of the above but different implementation. capture the many facets of how the functional requirements of an application are achieved [6]. Our application capturedLog4jLoggerFactory: This factory class extends the In- the following major quality attributes (S-M-E-P) that soft- ternalLoggerFactory which uses the org.log4j.Logger to wares need : provide the new instance of the ILogger class by pass- Scalability(S) : Scalability is one of the major concerns in ing the instance of org.log4j.Logger to the Log4jLogger client-server connection that is effectively dealt with in peer- class. ILogger interface provides the same functional- to-peer connection. In client-server connection, increasing ity as that of the above but different implementation. number of users on server may lead to total collapse of the server. On the other hand, peer-to-peer systems can have any number of users without the need to be concerned about3.5 Security central failure. System load is divided between clients. TheAt the architectural level, security boils down to understand- Maiar game is designed using peer-to-peer model to take ad-ing the precise security requirements for an application, and vantage of scalability that peer-to-peer connection provides.devising mechanisms to support them [6]. The most com- Modifiability(M) : Post-delivery maintenance [12] is nec-mon security-related requirements [2] are : essary in product development and as such corrective, per-Authentication : Applications can verify the identity of fective and adaptive maintenance are things that requiretheir users and other applications with which they commu- much attention and were taken care of in Maiar application.nicate. Corrective Maintenance : Apache Maven as our software
  • 8. 6. CONCLUSIONS However, today’s large-scale distributed applications span- ning from p2p computing, cloud computing poses new issues that are hardly addressed. Further work is to access the per- formance issues and perform some measurements to access scalability and other related issues. Performance issues like throughput, response time, deadlines and performance of the system are not consider because this paper did concentrate on the Maiar Architecture. In this paper, we showed that domain object modelling from XML datasource can bring a Figure 7: Deployment View. lot flexibility in software API development in general. Graph modelling of our XML datasource enhances the chances of reusability: constant model structure and integration withmanagement and build tool helps us to modularly maintain other systems because of platform-neutral syntax of XML.dependencies to resolve coding faults.Perfective Maintenance : But with the current archi-tecture approach and using more industrial practise like de- 7. ACKNOWLEDGMENTSsign patterns, interface-implementation approach gives more This work was done with the following people Murtala Ab-simpler learning curve to make additional changes if so re- dulrahman, Giorgos Georgiou, Collin D’Souza and Bushraquired. Saba when we were undertaking our Master’s in AdvancedExtensibility(E) : XML is used in the system to create Software Engineering at Department of Computer Science,a map of the worlds. Commands and descriptions are also King’s College London.stored in XML file. Whenever a user issues a command, itis fetched from the XML file and executed. One of the main 8. REFERENCESadvantages of XML is extensibility. [1] K. A. Berman and J. L. Paul. Algorithms: Sequential,Performance(P) : P2P connection aid network performance, Parallel and Distributed. Thomson Course Technology,in that the bandwidth of the system increases as each peer Boston, Massachusetts, 2005.arrives the bandwidth capacity of the system increases as [2] D. A. Blyth, D. D. Cunliffe, and D. I. Sutherland.more peers arrive: each new peer requests service from, but Security analysis of xml usage and xml parsing.also provides service to, the other peers. The network can Computers and Security, 2003.thus spontaneously adapt to the demand by taking advan- [3] B. Daum. Modeling Business objects with XMLtage of the resources provided by every peer. We might have Schema. Morgan Kaufmann Publishers, Germany,to performed more test to assess the performance of this in 2003.relation to our application. [4] T. Faison. Event-based Programming: Taking Events to the Limit. Apress, May 2006. [5] R. Garg, V. K. Garg, and Y. Sabharwal. Efficient5. DEPLOYMENT algorithms for global snapshots in large distributedThe executable program will be installed on the peer system systems. IEEE Transactions on Parallel andafter has successfully registered with the Maiar Server Web Distributed Systems, 99(RapidPosts):620–630, 2009.Application. For the client peer to work, it requires some de- [6] I. Gorton. Essential Software Architecture.pendencies which are just Java Executable jar files as shown Springer-Verlag Berlin Heidelberg, Germany, 2006.in Figure 7. A Peer requires the Java Runtime Environment [7] JGroups. http://www.jgroups.org/, 2010.(JRE) installed on the system to be able to play the game, [8] JXTA. https://jxta.dev.java.net/, 2010.Maiar. There is an optional installation process for Peersthat does not have the JRE installed on their systems and [9] Log4j.this is bundled with the Game installer deployed and hosted http://logging.apache.org/log4j/1.2/index.html, 2010.on the Application Server. Peer Dependencies: For a peer [10] Maven. http://maven.apache.org/, 2010.to successfully run the Maiar Game, these are the required [11] MySQL. http://mysql.com/, 2010.artifacts on their system: [12] S. R. Schach. Object-Oriented and Classical Software Engineering. McGraw Hill, Germany, 2005. [13] SlF4J. http://www.slf4j.org/, 2010. • Logging.jar: This artifact is the logging component of [14] R. Steinmetz and K. Wehrle. P2p systems and the application. It is required to provide the basic applications. LNCS 3485, pp. , 2005. Springer-Verlag logging functionality at the peer side. Berlin Heidelberg, 15(5):9–16, November 2005. • Model.jar: This artifact contains the domain model of [15] C. M. S.-M. Tim Bray, Jean Paoli and E. Maler(Eds). the game Extensible markup language (xml) 1.0 (fifth edition). W3C Recommendation, 26, November 2008. • Client.jar: This artifact contains the Graphical User [16] Tomcat. http://tomcat.apache.org/, 2010. Interface, which is the Swing Application with inter- active response and user experience. • Messaging.jar: This artifact is the most essential com- ponent of the peer dependency because of the