[brailleblaster] Re: Structure of Editor

  • From: Michael Whapples <mwhapples@xxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Sun, 01 Aug 2010 20:56:54 +0100

I really am uncomfortable with your terminology, it doesn't fit with good OO design. One in particular is the phrase "main method", what is that meant to be, what's the meaning of main method, what does it do?


Here is a reference to a book, refer to chapter 2, which mentions some of the ideas of OO and designing your classes (the paper book comes with a CD which has a non-encrypted PDF version of the book as well as some software with practice exams, shame the software isn't accessible the book is fine). I have seen it on amazon although this wasn't where I got it. Sierra, K., Bates, B. (2005) "SCJP Sun certified programmer for Java 5 study guide", McGraw-hill Osborne Media, ISBN-10: 007225360-6

Before going into detail, one standard worth possibly considering, although I do admit it may not be sensible to strictly follow it (SWT mention in their FAQ that there are cases where it doesn't make sense), would be the Java beans standard.

OK, now to what I am getting at. Classes should be encapsulated and coherent, bundles of related data (member variables) and actions to do on that bundle of data (methods). It should be that all member variables are not accessed directly but via getters and setters. Some examples of the actions therefore would be get, set, is (as a check), read, write, etc. So under this idea where does main fit in? I see no action there.

Then there is the point of abstraction, interfaces and polymorphism. One prime example I can see without getting detailed specifications will be the maths editor. We should have a MathsEditor interface which all implementations of maths editors should implement. As far as BrailleBlaster is concerned its dealing with a maths editor, it doesn't care how it works so long as it complies with the MathsEditor interface.

There is also the matter of coupling between objects, ideally this should be as loose as possible and some of the above should be able to help with this (separating interface from implementation).

Michael Whapples
On 30/07/10 16:44, John J. Boyer wrote:
I've been reading the source code for the TextEditor example from
eclipse.org/swt It seems to be quite a complete basic editor. The main
changes we would have to make for the text window would be to have it
update dom4j instead of writing to a file. After this is done we could
copy the result into another class called BrailleWindow and then
customize this class.

I'm thinking that we should have only one principle package
org.brailleblaster.editor Within this package would be the classes Main
which will contain the main method and get things ready. Then we will
have the classes TextWindow and BrailleWindow We will also have the
class Help the class ChangeSettings and so on.

Of course I expect disagreement. You have all sen me post some pretty
dumb iideas. But these ideas have served as springboards for discussion.
One purpose of this likst is brainstorming.

John B.



Other related posts: