I've been trying to get up to speed on Java. To do this I've been setting myself little projects.
I've decided to convert my "AlphaWords" thing-a-ma-jig to Java. This takes a string (say "Dog") to one of many phonetic alphabets (for example, using the nato alphabet, to "Delta Oscar Golf"). I got all this to work but I thought I'd make it a bit harder. What I want to do is make adding alphabets really easy - in a good OO way. Alphabets consist of two properties: a name (a string) and a list of 26 words/phrases (a string array - I think). The system takes the word list and adds it to an array (the indexes representing the ASCII code for the chars, both upper and lower case). It then adds a bunch of standard mappings for numbers and symbols. To do this I thinking.... 1) Create an abstract "AlphaSet" class that contains all of the standard symbols and creates the full array and stuff... then create separate classes for each alphabet. I'm having trouble with this tho' - since the only thing that changes are properties. You can't pass an instance variable to a "super" constructor. 2) Create an "AlphaSet" class that takes a name and a word list and returns a usable alphabet set. Then create objects that encapsulate the various sets and create and return AlphaSet objects... but I don't know how to do that. How do one object return another? 3) Something else? Something gooder? Obviously I'd like the objects representing the alphabets to be as small and simple as possible - you should be able to add new alphabets easily without touching any of the other code. Any thoughts? I'm looking more at this as a "right way to do it" (even if it's boringly dull and overkill) in Java rather than solving this specific problem. Jim Davis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 by AdobeĀ® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Community/message.cfm/messageid:231870 Subscription: http://www.houseoffusion.com/groups/CF-Community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5
