SSS (Small, Simple, Safe)
by Alper Coskun05/26/2004
Java is a popular introductory programming language used in computer science curricula, and is generally considered to be a simple, easy to learn, object-oriented language for teaching programming. So why do students have trouble learning to program with Java? I think it's because the Java language and its framework are tightly coupled. Learning the Java language alongside its framework is a significant part of this problem. A beginner in programming with Java may have difficulty distinguishing between the language and the framework parts (see "An Overview of MiniJava" by E. Roberts, ACM SIGCSE, 2000, for more information on this). Students should be able to examine the framework and the language independently.
Java has a large and complex framework for common algorithms, data structures, and more, which is also called its standard libraries. It is difficult to write a useful program without using the standard libraries. Most beginners suppose that this framework is a part of the language. It is not, however. Standard libraries are designed for professional programmers, not beginners; in fact, beginners usually get confused because of this enormous framework. That is a serious problem in courses with Java.
Unfortunately, the available development environments cannot relieve this problem; if anything, they cause even more confusion. They are also not sufficient for learning the standard libraries. There is no existing tool that helps students to realize the difference between the language and the framework part. On the other hand, some textbooks try to clarify the difference by giving some code examples, but the results are generally less effective than desired. Because they are printed materials, they cannot show the difference as clearly as a specialized tool. Such a tool, targeted particularly at new programmers, could illustrate only the Java framework and basic object-oriented concepts.
What Is SSS?
In this article, I want to introduce an educational tool that mainly addresses the problems above. It is called SSS, which stands for Small Simple Safe, and was written by Dr. Akif Eyler, a professor in the computer science and engineering department at Marmara University in Istanbul. The idea came from an ancestor tool that Professor Eyler had written to inspect the Java framework libraries for easing his own practice with Java. As he realized the gap in this area, he decided to make it a complete environment and created SSS in order to be used by the community.
|
Related Reading
Head First Java |
SSS is a simple tool that allows for handling various classes and objects. You can load classes and immediately build objects using public constructors. It allows for very quick access to public methods of any class. Using SSS does not require a knowledge of Java syntax. It allows testing a class just by clicking in the GUI; there is no need to write test code or to compile something with SSS for testing. SSS would be very useful for a beginner while learning standard Java classes such as java.lang.String or java.io.File. An experienced programmer would also benefit from fast learning, testing, and experimentation.
SSS in Detail
Where many Java development environments use their own interface in order to design and develop graphical user interfaces, SSS concentrates on using the user interface to illustrate the Java framework, making it easier to understand. SSS is not concerned with the Java language and its syntax. That said, it helps to be aware of the Java framework and some runtime practices of object-oriented concepts such as class hierarchy, inheritance, overriding, and overloading. Students can see how these concepts work in execution. SSS leads students to realize more easily that the Java framework is not a part of the Java language.
On the other hand, SSS is not only for novice programmers, but also for experienced programmers. They can use this tool for testing their own classes and for inspecting third-party classes. Professor Eyler uses SSS in the laboratory session of his class, "Object-Oriented Software Design", which is a graduate course. SSS also supports assignments of the course and receives favorable comments from the students.
SSS typifies the principles "Small Simple Safe," from which it gets its abbreviated name. It is small, at only 90KB. This contrasts with many Java tools that are too big and require extensive setup. SSS does not require any setup: it is only a JAR file, which can be run with a mouse click. It can be used without knowing Java, so it is simple. And it is safe, because only public members are accessible. Furthermore, SSS is a pure Java application, so it is platform-independent. Provided you have J2SE on your machine, you can use it.
SSS has two windows. One of them is the console, as shown in Figure 1. Every action by the user is written to this window. You can also save your actions, so you can use the console log when writing your actual Java program.

Figure 1. The console of SSS
The main window of SSS is separated into three parts, as shown in Figure 2. The left panel shows a list of classes and objects. The middle panel shows the fields of the selected class or object, and the right panel shows its public methods. The main window also changes its color when a class or object is selected.

Figure 2. The main window of SSS (You can click on the screen shot to open a full-size view.)
An Example in SSS
When SSS starts up, only two classes, Menu and Small, are loaded by default, and no objects are yet shown. The Menu class allows you to choose capabilities and add them to SSS, as various static methods. The getSystemClass() method of the Menu class is used for choosing a system class, meaning one that begins with java or javax. To load any other class, you can use Menu's loadClass() method. Furthermore, your classes and JAR files can be loaded at runtime, so SSS can be extended dynamically. This feature allows for the testing of your own classes.
For example, let's say you want to create some Strings with SSS. Just use the new String(String) public method of the String class. First, click on the Menu class, and the click on getSystemClass(String) from its public methods. Write "java.lang.String" (with quotes) inside of the pop-up window, as in Figure 3.

Figure 3. getSystemClass() dialog
Now, click on the java.lang.String class, which has appeared in the "Classes & Objects" list, and click on the new String(String) public method. Use the dialog to provide a name and a value for this new String. This step is shown in Figure 4.

Figure 4. Instantiating a String
Assume that we have created three strings, and we want to build up a set with them. Again, with the Menu class' getSystemClass(), we can load the java.util.TreeSet into SSS. Next, we make an empty instance of TreeSet with the new TreeSet() method. Then, using the add() method of TreeSet, we can add our previously created strings into the TreeSet instance, as shown in Figure 1 and 2.
In the end, if we call the size() method of TreeSet, we can see on the console that our TreeSet instance's size is 3. Without SSS, trying out the TreeSet's add() and size() methods would require us to write and compile a new test class. If we wanted to then try another method of TreeSet, we would have to compile our code again.
Menu class has a special method, called teach(). This method can be used for demonstrating any example in a step-by-step manner. It allows you to load a teach file, which has steps in plain text format. All of the steps performed in SSS can be saved, and then can be used as a teach file. There are also some ready-to-use teach files, which are bundled with the downloadable SSS. A similar method, teachSSS(), exists for teaching SSS in step-by-step manner.
Conclusion
This article explored the "Small Simple Safe" tool. SSS is a simple, multi-platform, easy-to-use tool for teaching the Java framework and basic object-oriented concepts. Its main motivation is to solve problems beginners experience in understanding the difference between the framework and the language. It allows users to handle Java classes and objects directly in the GUI. SSS's design goals include simplicity, user-friendliness, and the ability to teach and to test standard libraries and other classes visually.
Alper Coskun is a software engineer and part-time graduate student in Computer Engineering.
Return to ONJava.com.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 6 of 6.
-
learning Computer Science
2006-02-22 07:49:58 haobaba1 [Reply | View]
I believe the best way to teach students to program is to make them use something that doesn't give them a lot of distractions, something like a power C compiler on a floppy disk. No Libraries. No Object Oriented features. Let them learn basic programming contructs. Then teach them a new language that has slightly more abstraction. Fancy tools just get in the way of what really matters, learning to deconstruct problems into workable solutions.
-
What about Python?
2004-10-23 22:40:15 glenpepicelli [Reply | View]
Not to get off topic here but Python is an excellent way to learn OO concepts. After a class in python students may go on to C++ or Java.
Python is a fully hybrid language. A programmer can write fully OO software or software that uses no OO at all. This means you can ease into OO and compare it to non-OO solutions in the same language.- Python has a lot of builtin construsts and features. This makes it great for its intended purpose-- as a scripting/glue language-- but it also means it is easier to write non-trivial programs without being buried in details. For example python has builtin dictionaries that are very easy to use.
- Programs can be run interactively rather than compiled-- you can't get a shorter compile cycle than that.
- Python is easier to compile for beginners.
- Python has multipile inheritance-- so that can be covered.
-
BlueJ also has this feature
2004-05-27 09:33:40 cpjobling [Reply | View]
BlueJ is a simple Java IDE (avalable from www.bluej.org) which also has this sort of behaviour. You can instantiate an object of any class on the classpath by providing the fully qualified name and then selecting any of the class's constructors. Once the object has been instantiated, a small icon representing the object appears. You can then right-click on the object's icon to call any of the object's methods. Because BlueJ is an IDE and debugger it has privileged access to the JVM, which also allows you to also inspect the object to see all its private state.
BlueJ has built up quite a following in the educational arena just lately and there are several "CS101" text books using it (but none from O'Reilly). See the web site quoted above for more info and access to the lively discussion lists. -
BlueJ also has this feature
2004-05-27 09:45:40 alperc [Reply | View]
Actually, SSS does nothing that BlueJ cannot. But with BlueJ, the interactive use of Java class libraries is not as easy. SSS also allows to inspect the object to all its private state. SSS should be seen as a complementary to BlueJ.
-
learning a tool != learning a language || learning to program
2004-05-27 02:27:15 jwenting [Reply | View]
And yet another approach to teach students to use a tool or IDE instead of learning to program. -
learning a tool != learning a language || learning to program
2004-06-03 02:31:49 Eyler [Reply | View]
Learning Java has three rather independent aspects:
1. Java syntax
2. OO concepts: classes and objects
3. Java class library (API)
BlueJ is wonderful in the first two, but it does not supply much help for mastering the API. Small-Simple-Safe (SSS) is another approach, complementary to BlueJ, which bypasses Java syntax
altogether, and concentrates on the last two aspects.
It allows the student to invoke methods (lightning-fast) without writing any code.
It allows the instructor to write scripts that automate the invocation sequence to teach a certain topic.
I still encourage my students to use BlueJ, but once the program is written, they inspect their objects with SSS.




