SOFTWARE ENGINEERING METHODOLOGY
SOFTWARE ENGINEERING METHODOLOGY COMP 410
Popular in Course
Popular in ComputerScienence
This 8 page Class Notes was uploaded by Cleora Stiedemann on Monday October 19, 2015. The Class Notes belongs to COMP 410 at Rice University taught by Staff in Fall. Since its upload, it has received 18 views. For similar materials see /class/224960/comp-410-rice-university in ComputerScienence at Rice University.
Reviews for SOFTWARE ENGINEERING METHODOLOGY
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 10/19/15
I Evtraoldinary System Developer HEKInvEsh39nmts u mm m w M s mman assets The vm Lnrdnn Tckvn 2rd Hme Kane HEK s tukm in Exvaadnaw se wave memes m Jmn my mam m DaHas HEK has a u mve m exeewmce 2 Wm and d aga amusuhaE and nutstandm emdnvae bmems mmm sateen mask and mm um haahh mvaage Gvcuus have the suturer m sma Earns but the supuen svucme m a We dwduu em masmzanm meman autumated vegessmn resume at A vevv atnvgamzannna smme aHUNs in me DDDUanW m mama muss Earns 2rd unseen vnu buserss kneMedee and Expawerte We bum sc wave m we anws Matiner WNW a CMFC agan base New svstHns ave mu m a and ASP Net x H2 a the subla t Fmanua mm m wenmem mane musamust New m dead am an mdastandng Ame dw aate between wuvkm smavtand wakm me We ave gamma auevesswev and have sevea upen Dusmnns mmm 0 Gum Exvaxmce wamnq Wm verv avqe is e 0 Dmyeds LimMEevsGDF e Knaw edqe af des qn peems sun vedrhme mummeaese xnzegyannq mm eqey me Wm Necx msmmzm WPutimHq d mpumq Dee Managemmt Devean Exvawente Wm vav qu meme 9 W e dawases Yams a meme uav deem am apnmemn stared Dvatsduves msnthMmsan mehnq SawceSchmsafmndvsxs Semces Mm NEY Dmdwev mdxdae mum Dussess wamnq Knaw edqe a avvhtah n dwewment an the wmaws Warm Exvawente Mm Mmsan szud smdm Exvawente m 9 Exvawente m 0 asp NetWeh Deve ava mdxdate mum Dussess wamnq Knaw edqe a avvhtahan dmdwment an the Wmdaws P atfmm Exvawente Mm Mmsan szud smdm 2mm am zuus Exvawente m 0 ASP e asp NetZ u meme a PM TD 200W dease wsu my weeswe Chck Seavdw Pusmms men seemsvscems Dwenpev eteuege IDiscoverable Rules and Behavior Manafesto Jeff Morrow Intro I know that the rules and the behaviors are terribly complicated and difficult at best to understand unless you have them explained to you This document is an attempt to alleviate some of that confusion and describe the interfaces the interactions and the ow of the code IDiscoverableSimulation IDiscoverableSimulation is the interface of the object that is returned when a simulation returns its SimInterface public interface lSimulation ltsummarygt Returns the simulation interface type that will be Visible to agents ltsunmarygt object Simlnterface get ltsummarygt Used to check agent permissions when the agent attempts to perform an operation on the world ltSummaiygt lSecurityManager Manager get lt summarygt Called when an agent logs on to the system This may be called before LoadlnitialState is called If an exception is thrown the logon is vetoed ltsumm39 quotgt ISecurityToken LogonAgentlSkyNetUser user am name quotagent quotgtlt paramgt 4a void OnAgentLogonlAgent agent ltsummary Called when an agent logs off the system ltSummaiygt ltparam name void OnAgentLogofflAgent agent ntquotgtltpai n lt E LLIUIUELl y3 Loads the initial state of the simulation into the world ltsummarygt void LoadlnitialState When you are using an IDiscoverableSimulation agent it can freely cast the object returned from the SimInterface call to IDiscoverableSimulation and the methods to discover and run any and all behaviors can be implemented from there The actual code of the IDiscoverableSimulation interface is as follows ltsummarygt This is the simulation that the agents get to interact with the server when they request This allows a behind the scene a list of behaviors to be stored without needing to ltsummarygt public interface TDiscoverableSimulation i ltsummarygt The list of behaviors permitted by a particular entity ltsunmarygt ltparam namequotequotgtThe entity whos behavior list is being queriedltparamgt ltreturnsgtThe list of behaviors the entity can doltreturnsx ListltABehaviorLambdagt enumerateOperationsIEntity e lt srm tmarygt As opposed to enumerateOperations enumerateQueries returns the queries that an agent is allowed to do on the system ltsummaiygt ltparam namequotaquotgtThe agent whos behavior list is being queriedltparamgt ltreturnsgtThe list of queries the agent can doltreturnsgt ListltAQueryLambdagt enumerateQueriesIAgent a l The discoverable interface simply returns behavior lambdas and query lambdas for the given entity or agent There was a need for separate handling of each case primarily because the agents would by necessity have some manner of being told what entities they themselves own and thus what entities they can ask for the behaviors of The list that is returned has lambdas for the way to actually run individual operations on the simulation While Behaviors and Querys are implemented slightly differently in several ways they are the same so they both extend ISimulationLambda which is as follows ltsummarygt This is the general lambda for the Discoverable simulation This is used to encapsulate the various query and behavior operations that the agents are allowed to use The contract of this lambda is that the list of types in ArgumentType corresponds one to one to what type of elements need to be in the run argument array The help info and the media package are merely meant as help for the user and view to get the information describing the particular behavior in case they want to know more about it public interface ISimulationLambda i ltsummarygt Run this particular lambda with the given array of objects ltsummarygt ltparam namequotoquotgtThe parameters for the operation This will throw an exception if the 39 arguments are not of the type that is expectedltparamgt ltreturnsgtltreturnsgt int runobject o ltsummary2 Returns the name of the particular query or behavior ltsunmarygt string Name get lt SUV y This is a list of types that the lambda expects as arguments The param descriptors include the type and a description of the particular argument ltsunmarygt ListltTParamDescriptorgt Params get ltsummarygt A description of the behavior This is meant to be returned to the user in case the user wishes to know in more detail what this behavior or query will do ltsunmarygt string Description get ltynm V In the event that the view wishes to have a media package associated with a particular behavior then this method returns the string that is the particular filename to associate with this behavior ltsunmarygt string MediaPackage get ltsummary2 This returns the type of the class that implements the behavior The class that gave this type must implement TWorldBehavior in order to run properly ltsumma Type worldBehavior get ltsummarygt This returns the type of the class that implements any queries requested by the behavior The class that gave this type must implement TWorldQueryLambda in order to run properly ltsunmarygt Type worldQuery get ltsummarygt This returns the type of the class that implements any effects the behavior wishes to have The class that gave this type must implement TWorldAffectorLambda in order to run properly ltSummarygt Type worldAffector get Both queries and behaviors have the ability to do any of these things Note in the case of run the behavior will return null wheras the query will return type object It is expected that the requesting agent knows that the first param descriptor in the Params list is the type of return Both Behaviors and Queries have an abstract class that implements the run method This run method is not extended by the concrete class and is instead implemented by the abstract class as the implementation of the rules layer Behaviors Behaviors exist as the interaction of a number of different classes but primarily ABehaviorLambda ABehaviorLambda has a run method that performs the rules check and then constructs and runs the class given by the type in worldBehavior s run method When constructing a behavior you extend ABehaviorLambda implementing the name description typelist and give it the proper IWorldBehaviorLambda type that you wish to run The IWorldBehaviorLambda interface has one method of runIWorldQueryLambda IWorldAffector object The object is the same array that was passed to the ABehaviorLambda s run argument The IWorldQueryLambda and IWorldAffectorLambda are both classes that might be built specifically for this behavior or a more general one for many behaviors Essentially what these do is encapsulate any database queries into various methods of the IWorldQueryLambda and any database changes in the IWorldAffectorLambda These are the only parts of the behavior code that get access to the database and I will detail further in the rules section the real purpose behind them Essentially the IWorldBehaviorLambda class needs to do the work of calling whatever appropriate methods of the query and the affector that it wants to in order to perform the behavior It can cast the query and affector classes since they are going to be the same ones that got a type in the abstract ABehaviorLambda class The two database classes will need to have the necessary methods to search retrieve and store whatever information that the behavior wants abstractly Rules This is where it all starts to come together The rules are actually a three stage process Stage 1 7 finding the rules that apply 7 This is a minor black box at the moment but one that there s been work on I m not quite ready to discuss it at this time Stage 2 7 execution check The find rules will give back a list of IRule objects that are all ordered into some form of precedence The IRule object looks like this public interface IRule bool doNotExecuteObject o IWorldQueryLambda worldQueryIWorldQueryLambda q object o IWorldAffectorLambda worldModifierIWorldAffectorLambda q object o IWorldBehavior worldBehaviorIWorldBehavior q object o I What happens first inside the run method of ABehaviorLambda is the rules are found from the database Once these rules are found and ordered they are iterated through and the doNotExecute method is called given the arguments that were given to the run method in the first place This is designed such that it would be trivial to completely halt the execution of a behavior before it even got started running If a rule is going to halt the execution why bother with the computation of the code and difficult database queries In any case once the doNotExecute call has been performed then the second rules pass executes Stage 3 7 This is the more complicated step of the whole proceidure so hopefully I don t loose you The rules are now iterated through and for each rule the worldQuery worldModifier and worldBehavior methods are called with the current IWorldQueryLambda IWorldAffectorLambda and IWorldBehavior as arguments Whatever WorldQueryLambda etc etc is returned by the rule is set to be the current entry of all of these When all of the rules have been iterated through the current world behavior is run given the current world query and world modifier lambdas This is actually a version of the decorator pattern allowing the rulemaker to not only accept or deny the operation of a behavior but to actually change the way the behavior operates in a variety of ways If the rule decides to give the behavior false information when it is called it can either wrap and modify the results of the worldQuery or even replace the worldQuery with another implementation entirely Notice that any new implementations will have to override the concrete class that the behavior is expecting but a completely different implementation can be put in place Similarly the behavior could be fully modified or changed by a rule Finally even if the query and the behavior were left unchanged the way the behavior actually affects the world could be halted redirected or mutated in any number of ways inside the worldAffector By following the encapsulation of querying in one spot operating in another and affecting in yet another it allows a very exible implementation of rules Since the rules are stored in the database under a exible searching method rules can be dynamically loaded or deleted at any time without any affect on the program at large If a rule so wishes to not modify a component it is not necessary for it to rewrite the particular spot but simply to return the argument it was given It will pass on to the next one I ve done a fair amount of work to try and ensure that all behaviors will follow the rules as they are laid down though the people who are allowed to input behaviors should be reasonably trusted to not be terribly malicious Behavior writers do get access to the database and unless you have a default deny all rule then it is possible for bad things to happen Jack Chi May 07 2006 Comp 410 SkyNet XML Entity Creation Schema The following will describe how to create a SkyNet Simulation XML le and properly load the schema into the Database entities with attributes Emiter Value Guid Type t r l Attribute Attribute l Value st 39 ring SisyNetDataSet sigyrietoatasgt En 39 En 39 Entity Entity Attribute Attribute Gurd string Guid string 39 Entitde int Type string Entity1d int All SkyNet related Entity Creation XML Schema needs to have the following identi er ltXm versionquot10quot standalonequotyesquot gt lttestDataset xmlnsquothttpskynetriceeduSkyNetDataSetxsdquotgt Here s an example of how the structure of the XML Entity Creation is setup ltEntitygt ltGuidgt String representation of the Guid of the Entity ltGuidgt this tag is optional if it is not provided it Will be generated upon creation ltAttributegt ltGuidgt String representation of the Guid of the attributeltGuidgt ltNamegt String representation of the name of the attribute ltNamegt ltValuegt String representation of the value of the attribute ltValuegt this value can be a double and the type Will be automatically casted inside addAttribute in Entity ltIsStringgt Boolean value ltIsStringgt ltAttributegt ltEntitygt The number of Entity and Attribute occurrences can be unbounded The entity creation is modeled inside Simulation gt Behavior namespace since we want to create entities dynamically at run time For more information on the Behavior interface look at IWorldBehaViorcs inside SkyNetgt ServerShared for the common shared interfaces used by the server model of SkyNet The DataSet used to translate SkyNet database into a structural form is called SkyNetDataSet in Shared The XML loadingsaving models after the design of the database In order to fully understand the conventions used please read the database documentation or talk to John Yue xyl and Sarah McGee smcgee The basic structure of the XML format is based on Rows and Columns EntityRows and AttributeRowsO For each row you can get the Entity and Attribute for each row In the saving process the Guids are also stored so when the XML is loaded back into the database it will be mirrored