CSc 221 Spring 2007

ADDED 8.12.2007: This is the 221 page for SPRING 2007, for reference. Homeworks and many details are different for Fall, 2007--but not drastically different.

CSc 221 Software Design Laboratory Spring 2007
Prof. McCracken/

NAC 5/150

Prerequisite: CSc 212, Data Structures
Office: NAC 8/202E
Email: mccracken@cs.ccny.cuny.edu or ccnyddm@aol.com
Website: ccnyddm.com check for news, homeworks, etc.

Text:
Deitel and Deitel, Java How to Program, Sixth edition, Prentice Hall, 2005. Sigh. Seventh, actually. It's published; it's what the bookstore has. I haven't seen it and don't know how much difference there is. I will attempt--but I can't promise--to make the course work for you whichever edition you have.

ADDED 4.21.2007: The second midterm, scheduled for Tuesday April 24, has been cancelled. Instead, we will have two quizzes. The first, on Thurs Apr 26, will cover the basics of generics and collections. The second, probably on Thurs May 3, will be on some Java-related aspect of the project, perhaps on processing dollar amounts stored as pennies. This will require some changes in how I compute grades. The syllabus speaks of "Tentative grading."

ADDED 4.21.2007: The final project will be a greatly simplified ATM. Click here to get to the final project page.

My problem with the second midterm is that it would have to be on something about the MVC design pattern, and you've already been tested on some of that twice. A third time would be pointless.

ADDED 4.13.2007: The "Swiss Bank Accounts" are posted.

ADDED 4.12.2007: HW6 is posted.

ADDED 4.12.2007: There is NO QUIZ today. Maybe I said, at some point in the past, that there would be. If so, that got superseded when I turned up sick that last day before the break. There WILL be a quiz, on the MVC design pattern as implemented in the temperature display program, on Tues April 17. The second midterm will  be on Tuesday, April 24. You are responsible for everything in the course through HW6, but there will be a concentration on what we've done in connection with HW5 and HW6. You are responsible for as much as we do, on exception handling and layout managers, in HW6.

ADDED 3.14.2007: Click here for an overview of HW5, for which there are new teams. New stuff added 3.22.2007.

ADDED 3.13.2007: Click here for some tips on HW4, the JUnit group. Also has some pointers on strings, although there are no pointers in Java, of course.

ADDED 3.8.2007: The first midterm, covering everything in the course through HW4, will be on Thursday, March 15.  Tuesday, March 20.  There will be NO coverage of HW5.

ADDED 2.27.2007: There will be a Quiz, covering mostly HW2 stuff but could be anything, on Tuesday, March 6.

ADDED 2.19.2007: HW4 is posted.

ADDED 2.12.2007: HW3 is posted.

ADDED 2.12.2007: Quiz 1, covering the technical material you needed to do HW1, will be Thursday, Feb 15. Tuesday, Feb 20. (Thurs Feb 15 follows a Monday schedule. I announced it correctly in class.) This is less notice than I will usually give, so I will make it a relatively easy quiz. (I have no idea why this is underlined. Doesn't look that way in FrontPage.)

ADDED 2.10: About Submitting Homework

ADDED 2.6.2007: HW2 is posted.

ADDED 1.30.2007: HW1 is posted.

 

Here's a summary of things that have been said piecemeal through the early sessions.

Jorge Castañeda, who took the course two years ago, found a tutorial on preparing JAR files: http://www.cs.laurentian.ca/badams/c1047/eclipse-tutorials/export-tutorial.html  The author, who is Canadian but I can't find his or her name, had slightly different requirements on some details. You will have no trouble adapting to our situation, I think. If you don't like that tutorial, ask Google for a JAR tutorial; you'll get something over a million choices! Love the Web.

 

Syllabus

Goals of  the course:

To help you develop considerable proficiency in Java. We have a good text and I trust the lectures will help, but you will learn programming by doing it. You will be working on some kind of programming assignment at all times except exam days.

·         To help you develop a reasonably full understanding of object-oriented programming: what it is, why it is important, and how to do it.

·         To extend your command of what is meant by program design.

·         To introduce you to the Java approach to compilation and execution, which involves the Java Virtual Machine executing bytecode. This is the heart of Sun’s slogan, “Write Once Run Anywhere.” We will see how this applies to code in everything from Enterprise computing (mainframes, which are definitely not dead) to the software that runs radios, car engines, anti-lock brakes, and a great many other things. It is the heart of IBM’s strategy for developing Web-based applications, using Java, Linux, and the DB2 (or any other) database system.

One of this text’s outstanding features is that all code examples are complete programs, and the programs are on the book’s CD as well as available directly from Deitel. I will be using these examples in many/most lectures. I don’t know how it will be possible to pass the course without a textbook. There are three copies on reserve in the Science Library. Check Barnes & Nobel and Amazon for used copies.

I will provide each of you with a CD containing all the examples and considerable other useful material. We need to get off to a fast start, and time wasted finding stuff that I can easily provide you is an unacceptable waste of your time and of course time.

We will review the basic ideas of object-oriented programming (OOP). You should have seen encapsulation and inheritance, but probably not the third leg of OOP, polymorphism. We will study graphical user interfaces (GUIs) in some detail, although it will be impossible to cover more than a fraction of the power that Java provides. You will get enough experience with GUI development to learn the rest of the subject on your own; we need time for things that are not so easily learned by oneself..

We will explore some of the advanced features of Java, things needed for any serious computing: regular expressions; collections (sets, maps, and lists); accessing databases with JDBC and some selection from threads, generics, and serialization.

We will explore some of the ideas of the widely-accepted practices of Extreme Programming. One key feature is that most if not all projects will be done in teams of two people, who will work whenever possible at one computer: one person types, the other proofreads and makes suggestions. The two trade places regularly. I will form the teams, at least for the first half or more of the course.

I love email. Talk to me: ccnyddm@aol.com, or mail to mccracken@cs.ccny.cuny.edu will be forwarded there. I check my mail many times a day, usually. I can’t promise instant response on all occasions, but I try.

Tentative grading, subject to change depending on how we do the project:

·         Homeworks: 25%

·         Quizzes (about 5): 20%

·         Midterm I: 15%

·         Midterm II: 20%

·         Final project, which will have several separately-graded deliverables: 20%.

In computing your course grade I discard your lowest homework and your lowest quiz.

This is one of my favorite courses. I designed it and introduced it, and have taught it 20+ times. I never get tired of it, in large part because it’s always changing. I take great delight in showing people student projects, which are highly educational and satisfying to all. The switch to Java has certainly made the course more interesting for me, and now that Java is the world’s most widely used programming language, Java is really the only reasonable choice for the course.

NOTE: We will be using Java 1.5, sometimes also called Java 5. It has some neat features, and some of these are used in the sixth edition of the text. The course CD contains JDK 1.5 for Windows.

We will be using two IDEs (Integrated Development Environment): JCreator and Eclipse. JCreator Learning Edition is a free download. JCreator and Eclipse are on the course CD.

There will be two midterms and a major project, but no final.

Tentative Homeworks, 221 Spring 2007

  1. Something a lot like HW1 in some previous semesters, but with various modifications. The course CD that you will receive has a “starter kit” version, a program that does part of the job. Your assignment is to modify it to include some additional fields and additional processing. There is a lot of new stuff here, for most of you. (Samples: allowable modifiers on top-level classes; extending a superclass vs. implementing an interface; constructors: when supplied, overloading; super and this; inner classes; event-driven programming with event listeners; JavaBean style for writing classes; more.) I don’t expect you to understand every detail of the program that you turn in. You will learn a lot doing the modifications, and we'll be back to all of the new concepts.

    The assignment also involves an introduction to Eclipse, which will be the primary Java IDE for the course (although Eclipse is much more than just a Java IDE.) Click here to see the tutorial on Eclipse, updated to use this semester's HW1.   Click here to see a screen grab of what might be your starting point, meaning that I will give you (on the course CD) a program that produces this image. You modify it to include a ZIP code and do a bit of error checking, for HW1.

    See 221 Spring 2007 HW1 for a statement of the requirements.

  2. For HW2 the main emphasis is on a lot of error checking, using Java facilities such as regular expressions—which every computer science and computer engineering student needs to know—and the methods of a class. Several additional fields, a more user-friendly interface, automatic positioning of the cursor in the next field when Enter is pressed, etc.

  3. HW3: Computation of the square root of 2 to ?? places. A thousand? A million? You will each get a CD with software and other course files, including one with the square root of 2 to five million places. I don't know how that computation was done; we will do it using rational arithmetic, in which every number is held as an object containing the numerator and the denominator, each as a BigInteger, which is a Java class that we import. Concepts: object-oriented programming, a tiny bit of math in the continued fraction representation of the square root of 2, using Google to find information needed to do the assignment.

    Curious? Here's the square root of 2 to 100 places:

    1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727
    which is
    979291172255376750081652821559640563801792871084643
    divided by
    692463428657900307544320387485120303323686251920582

    The straightforward continued fraction will get you any number of correct decimal places, but it does get rather slow. You will be asked to use Google to find and implement a very much faster variation. .  Search on Babylonian Method for finding the square root of 2.  This is apparently the best method known, in the sense that it converges rapidly. It is also the earliest example of an algorithm. (If it seems like I've made two different assignments here, don't worry about it. We straighten such things out.)

  4. HW4: Same thing, except add JUnit testing. Not sure about this. These two might be combined into one, or we might keep a separate assignment, but with a different computation. May wait until I see how much time we can usefully spend on the first three homeworks.
  5. HW5: The Model/View/Controller design pattern; building a GUI to display temperature. Issues: the design pattern concept; the MVC pattern, which is arguably the most pervasive and perhaps the easiest to motivate (a simple Excel spreadsheet will do that); the Observable class and the Observer interface; free-form fun & learning with creative ways to display a temperature. I don't think we do right by design patterns; I can at least introduce a couple, in context. You learn a lot about building GUIs with Swing, entirely on your own. (In the School of Education this is called self-motivated participatory learning. Or something like that, maybe. Names aside, you need to be able to learn on your own; helping you learn how to do it is very much one of the goals of the course.) Click here to see some sample displays.
  6. HW6: Java Collections, with probable focus on the HashMap or HashSet. These require overriding the equals() and hashCode() methods of the Object class, the top of the class inheritance tree. Writing Java code to produce HTML; the final output is presented as a Web page. If there is time, we'll look into using the two collections whose methods are all synchronized (but that's slow, and you have only Vector and Hashtable), or calling methods on the full range of collections but from a synchronized context. The issues: the dangers of multiple users accessing the same object, leading to inconsistent data; the problem of deadlock. After studying threads for a lot of hours in preparation for passing the Sun Certified Java Programmer exam last week, I doubt whether it makes sense to do a two-week project on threads, handling synchronization and deadlock at the thread level. It's a big, tough subject. In two weeks you would learn enough to do a Mickey Mouse project., which would give you no appreciation for how hard it is to do all this right. You have a full semester on operating systems, where this will be one of the major topics.
  7. Final Project: A database of some kind (we've used employees and books in previous semesters), using MySQL and the Java Database Connectivity (JDBC) functions. Creating a user-friendly GUI; user testing; SQL query basics; storing BLOBs (binary large objects, e.g., graphics) in a relational database; PowerPoint presentation of user testing results; submission of a working prototype before final specs are provided (this is real life); class presentation by every team. (But nothing on Third Normal Form and all that; this isn't a database course, although you will use a very real relational database.) Students get significant choice on formation of teams for the final project; I assign teams on all regular homework. All homework is done in teams, for good and sufficient reasons that are discussed as part of the course content and goals. There are typically five "deliverables" in a 221 project, each with a deadline and a grade: a design, a running prototype, a PowerPoint report on usability testing, and the presentation to the class--graded separately on functionality and on the team presentation.

Hmmm. What's missing? Well, polymorphism, in terms of a serious meaningful example. I'm still hunting for that good example. See the remarks above about Mickey Mouse assignments with threads. Same problem, so far.

Somewhere along the way I will make a valiant effort to introduce UML. The course is called Software Design Lab, after all, and the project requirements include a design. I have used CRC cards (Class/Responsibility/Collaborators) a few times, with mixed success.

Correction of possible misinterpretation. I may have made it sound as though every assignment is two weeks. Might seem to make sense: 14 weeks, 7 projects, = 2 weeks per project. But there are two midterms, which essentially use up a week, and the final project needs more like 3.5 weeks. Think of five projects at 1.5 weeks each, plus one at 2 weeks, plus midterms and the final project. Details may vary. (There is no final.)

A good homework assignment is one that you first look at and say, "There is no conceivable way I could do this in two weeks." Two weeks later you turn it in, correct and working, absolutely amazed at how much you've learned in two weeks. That's called a "challenge": something that forces you to struggle and stretch your wings, but which I know you really can do. I know of no better way that to learn this stuff. In fact I don't know of any other way to learn it.

This course won't make you an expert in Java or object-oriented design and programming, but you will know how to teach yourself the rest. At least this what former students have told me they like about my courses. The highest praise I can imagine, for any teacher.

Back to the top of the Spring 2007 CSc 221 page

Back to Dan McCracken's Home Page