# Assignment #1: Notepad

Due Tuesday, January 29, 8pm

With this file, you will find source code that I found on the web for a Notepad application written in Java.

- to compile, run: javac *.java
- to run, leave the Notepad directory, make sure that Notepad is in your classpath, and run java Notepad.Notepad

> > Note: to make your life easier, I modified the code so that it compiles into a package and that icons are accessed as resources. Further I restructured the code so that it should be easy to convert into Jak format -- namely, I eliminated nested classes.

Run Notepad. You'll see lots of possible features that are optional. Your assignment is:

1. to create an AHEAD model for Notepad, clearly identifying what features are optional.
2. use ATS tools (such as modelexplorer) to "pull apart" Notepad so that you can create variations.
3. demonstrate how a product-line could be created from your design.

Keep the following points in mind.

1. PLEASE READ THE AHEAD TUTORIAL/MANUALS!
2. Convert the Java code to Jak code. This is largely done by placing all code in a single directory and replacing the statement "package Notepad;" with "layer Base;" (or whatever name you want to give the constant of your model), and replacing super("...") with Super(String)("...").
3. Remember, when you compose layers, you will be building a package whose name is the name of the equation.
4. This is a simple and single application where variations are something of your own creation. Normally, variations are characteristics of a domain and not something that you invent for the sake of creating work. In fact, typical domains have different features that are incompatible. You may have to be creative to define such features. (They exist -- you figure out what they might be).
5. Applications that are not written with features in mind may need to be restructured (possibly significantly) to make AHEAD generation (or any generation technique, for that matter) to work. So, don't be surprised that you will have to restructure the code in order to match the capabilities of your model.
6. AHEAD tools generally do not work with nested classes -- only one Java (or rather Jak) class is defined per file. If you absolutely must use nested classes (or nested interfaces), use pure Java (i.e., no extended-Java) statements.
7. Customizing small files often needs String constants as parameters. AHEAD tools do not (at present) allow you to customize a layer by parameterizing it with one or more constants. For now, don't worry about String constant customizations.

You are to submit to me via email a zip file that contains the following:

1. your model directory, with features and equation files
2. an html page that explains each unit of your model and each equation file
3. a bash script that builds each notepad variation. The bash script must be idiot proof!

### Your Submission

The goal of this assignment is (a) to become familiar with AHEAD tools, (b) to become familiar with how an application can be partitioned into required & optional layers, and (c) how the pieces can be recomposed. So, if you have 6 layers, you might have 2**5 possible combinations. I don't want to see or run 2**5 combinations.

In your hand-in document, you should explain how many legal possibilities you have, give say 3 or 4 (tops) equations as examples that you think best illustrate the above points, and a bash script that builds them. You might also explain how "fine" you might be able to take your decomposition -- where "termination" stops when finer distinctions can't be reasonably justified.
It is possible that there might be slight differences in the composed tools -- menu items might not be the same as the original. That's OK.