[Cs5500] Fwd: SCG Game design

Karl Lieberherr lieber at ccs.neu.edu
Tue Mar 8 22:45:50 EST 2011


This is of interest to the class. DRY is in
http://www.pragprog.com/the-pragmatic-programmer/extracts/tips
which we started to discuss on Monday.

-- Karl


---------- Forwarded message ----------
From: Anush Prabhu Ramachandran <anush.rockingg at gmail.com>
Date: Tue, Mar 8, 2011 at 9:16 PM
Subject: Re: SCG Game design
To: Ahmed Abdelmeged <mohsen at ccs.neu.edu>
Cc: Karl Lieberherr <lieber at ccs.neu.edu>, rashmi nayak <rashmin at ccs.neu.edu>


Hi Ahmed!,

Thanks for your input, now the Project looks better!.

Please find the attached zip file.

Thanks,
Anush.


On Tue, Mar 8, 2011 at 6:16 PM, Ahmed Abdelmeged <mohsen at ccs.neu.edu> wrote:
>
> Nice work, it's a great starting point to improve on. Here is some feedback to guide the improvement:
> DRY (Don't Repeat Yourself) is an important software development principle that you most probably know about. It is violated in a number of cases here:
> 1. The scg.cd /beh ... are repeated between both the directory.


We made 2 separate projects for HSR and CSP for initial testing and
work split up. Now the attached zip contains single scg.cd & scg.beh.

>
> 2. The code for protocols can be made generic (i.e. at the scg game level) by replacing the line
>
> HSRInstance i = (HSRInstance)provideResponse.getInstance().getInstance();
>
> with
>
> InstanceI i = (InstanceI)provideResponse.getInstance().getInstance();

This change is implemented both in hsr and csp and tested.

>
> same for the protocols in csp.
> A better solution yet, is to make Instance implement InstanceI and forward it's methods to the "inner instance I". It is also possible to localize the calls for finish parse in Instance.
> 3. The protocols in both the csp and hsr can be reused across other "domains".


The Protocol is now under scg which can be reused for all domains.



More information about the Cs5500 mailing list