From: Rainer M. <rai...@we...> - 2007-01-20 23:07:20
|
Here comes the first BIG patch with the implementation of a AboutDialog, UserConfirmation and RailsSwing as the new starting class. Design Desissions and other thinks: - Refacoring double code I have not refactores your code, if I have doubled or moved it (see version), since I don't no if you want to follow me. I will if you like = it and accept my patch. - RailsSystem Need a place to initialize Rails spezifig environment thinks, Game is more game-rule-spezifig, Util should be the place for stuff, you can use also in other programs. - getLogger() Can be also in Util. I put it in here, because it is a rails-spezifig = way to log.=20 Find the Logger over a Method makes it easiar to change the fist desission to log on package-level. - VERSION Final variables should be written in upper letters (Sun-Conversion) We are using 'ea' as a version suffix to show users, that say are = using an early acces version (if they using the shnapshot) - getVersion() Try to avoid direct acess to variables, even if thy are final. That = makes changes later on easer. =20 - INTERNATIONAL_DISCLAIMER/USER_CONFIRMATION Those are the text-versions, witch should not be changeable by the = user. I put a version also in the localizeText.properties, but there is just a sublementary version for the local language version. If language is not default or en, you will see both text-versions! Please have a look at the text. I have used your recommentation but sublement some more sentence to it. Hope you can life with them and = Brett should correct theme, if there are bugs in it. =20 - RailsSwing Renamed RailsMain to RailsSwing to show, that this is the startpoint = of a Swing implementation - SwingUtil Util class for Swing utility methods and constants =20 - AboutDialog The look of the InfoFields is look&feel dependent. I did not have the time yet, to bring a change look&feel class into the project, where this would be normaly set. I would like to see an image/icon for rails, having some idears. Have = you one ready or should I go on (Making an 'R' with the base-green/yellow/green/brown/grey colours of 18xx) If we want, we can expand the info with copyrigth information, = authors, ect. =20 - Options Have just integrated the userConfirmation, using your style (because = I want not to change to much yet). A User has to confirm, that he owns the boardgame. You suprised me by using the GridBagConstraints variable for more = then one place. I'm sure, that this has not work inprevios versions of the = java virtual maschine. I will optimize my code with this informattion in the = near feature (if you accept the code at all). =20 - StatusWindow Same as Options with the help-menu. =20 - LocalizeText.properties All the new Text. =20 - Util - isEquals() Do you have a spezial order in methods? I just put it at the and = of the class. Feel free to move it. =20 - Config (comment) - Much better not as static class, So you can have userConfig and systemConfig. Both should than accessed by RailsSystem or maybe better Util-Methods - Where do you define the default-values? (if the file is coruppted = by the user) =20 - CodeStyle (comment) - public and protected variables: You are much to broadminded with = it. You should capsulate as much as possible, using getter- and = setter-methods for access. - static: Much to broadminded also. You should avoid static as much = as possible. (static constants are a break in the rule) You will get a lot of trouble to bring this code running in a server-environment. No chance.=20 Even singletons are not very good on servers (but easy to transform). RailsSystem as a geneneral System-API-Class and Util for general transformation and methods should be the only Classes which have static methods which are not factory methods or system-wide-parameters Hard words but I have a bad feeling for the time this project groose = more complex and it will be nearly imposible to have a server-side-version = with multible games with this code. Start smart is a good thing, but some day, you have to redesign it = and if you go this way farther it will be imposible someday - sorry. I know, my code is not a good example how it shoud be (since it is = not much code at all and most of it in RailsSystem - the exception of the = rule,=20 Maybe I can refactor LocalText or Config to show you what I mean, if = you want it. Too catch your angst about no new features, you should not change all = at ones anyway. Just one class in a month or quarter. That won't cost you = much time and brings you forward. =20 - Questions - Java-Version Which one are you using? By know I have used only 1.4.2 syntax, = but would like to go up to 1.6 (or 1.5). 1.5 should be faster and has more type-safty and a enumaration. 1.6 should be faster then 1.5 and has some advantages in = web-services At work, we are using still 1.4.2, becouse we have some third-party-libs, which are not compatible with 1.5, but I would like to = get experince in 1.5/1.6 Hope you like it. Regards Rainer |