header image
Check this page for updates on upcoming classes, our learning goals, and the lesson modules we'll use to get there.

Session Calendar and session guides

CIT-130 Object-oriented Java

Session guides

Guiding questions, objectives, lesson activities, and out-of-class assignment listings are available for each class session. Click "toggle full session guide" to view all the session's sections.

Wednesday, 5 September 2018

Return to Java objects and stacks

live_helpGuiding questions

  • What is an Object again? How do I structure member variables and methods into a structure?

check_circleLearning Objectives

  • Renew fluent writing of the Java language
  • Demonstrate the basic operations on a stack: pushing and popping

bookResources

listLesson sequence

  1. Course overview and syllabus discussion.
  2. Choose an interesting tool, like a nail gun or bubble level as pictured, and write a simple class to model that tool's behavior. Include member variables and methods. NO MAIN method in this one, since a client class must instantiate this class as an object.
  3. Create a second class in addition to your tool model class. In the main method, create two instances of your tool objects. Set a member variable on each such that they can be differentiated when we oragnize them in our stacks.
  4. Using the API reference linked here and in the resources section, create an instances of java.util.Stack. Use its push() method to insert each of your tool Objects into the stack. Then call pop() once to retrieve the most recent tool Object. Display on the console one of its unique member variable values.
  5. Pop off the second object and show its unique attributes.

playlist_add_checkMid-week ToDOs

  1. Make sure you have NetBeans setup on your home computer
  2. If today's exercises were a struggle, revisit our Java CIT-111 modules and write some java code along with some of those tutorials to get your head back re-oriented.

sendProducts

  • An in-progress set of classes, one tool Object class, and one client class with the main() method.

cakeExtension exercises

  • Demonstrate each of the remaining methods in the java.util.Stack in the same main method we pushed and popped. Use printlns to show which objects have been manipulated, viewed, etc.

arrow_upwardback to schedule


Monday, 17 September 2018

Class relationship diagramming and interfaces

live_helpGuiding questions

  • How can I graphically show the differences between a LinkedList object and an ArrayList object? How can I graphically show their similarities?

check_circleLearning Objectives

  • Create a class digram that shows the inheritance of methods in an interface by a subclass
  • Write the implementation of a given interface in a subclass.

arrow_upwardback to schedule


Wednesday, 19 September 2018

Not those maps, these Maps!

live_helpGuiding questions

  • What is all this fuss about maps, anyways? How are they different from lists?

check_circleLearning Objectives

  • Create a tangible representation of a map with literal keys and String values
  • Implement an expedition planning tool that uses keys as attributes of a expedition

straightenNote card diagnostic

bookResources

listLesson sequence

  1. Choose a location to which you'd like to lead an expedition of some kind: scientific, recreational, exploratory, etc. The location doesn't need to be on Earth.
  2. Create a set of attributes about this expedition to store in our map, such as: location name, duration, purpose, cost, crew size, resources required, etc. These are our data keys. Write each one on a 1/2 note card in PEN, tape an actual key to it, and tie that it to a value represented by a note card whose text is in PENCIL.
  3. Study our sample code that shows putting and getting from a map, and iterating over a map's data using an iterator.
  4. Write your own code that converts your physical keys and values to digital ones inside the Map object in your code. Use the put(K,V) method to store your data and the V get(K) method to show you can retrieve that data.
  5. Build out a user interface which allows the user to look up a value in the expedition's map by typing in the appropriate key into the console. The user should be given a display of the possible keys so they know what to type.
  6. Keep going: once you can hard-code map inputs and allow the user to view the data, build out your interface to allow the user to adjust the values of the various trip parameters and display those values.
  7. When your program is commented, the author tag correct, and it runs, upload your code to your GitHub repository.
  8. Prepare for other students to run and share your code next week!

playlist_add_checkMid-week ToDOs

Continue building your expedition program, taking time to digest and read about Maps, Sets, and Iterators/ Iterables as you go.

sendProducts

Working, commented, and understood code conforming to the project step specifications in this document

cakeExtension exercises

  1. Assume you are building a prototype of an expedition management service for some small, garage-style version of NASA. In this organization, there is a period of time in which an expedition's attributes can be adjusted. Once the mission directory locks the expedition plan, however, no further changes are possible.

    Implement these business rules in your program such that your expedition map contains a key called "locked". Create a final String type variable that stores the value that this key must contain in order for the map to be considered "locked". Before any changes to the map are allowed, the program must check the value of this key. Locked maps must not be changed, and the user should be given a semi-friendly error message.

    Create an option when a menu is displayed to the user to lock the expedition. If the option is selected, the program should insert the appropriate value into the key's value container to lock the set (or unlock it).
  2. Implement a password access system on the locking mechanism from the previous extension idea. If the user wants to lock or unlock an expedition, a password must be entered. If you get ambitious, don't store the actual password Hard-coded in your program, take the hash of the password, store that, and compare the hash of a user-entered password with the stored hash of the actual password. You'll need to do some reading about hashing!
  3. Create a method for the user to duplicate the keys in an existing expedition when creating a new one. Choose an appropriate method on your map for making this possible.

arrow_upwardback to schedule


Monday, 1 October 2018

topic

live_helpGuiding questions

  • What?

check_circleLearning Objectives

  • Holistic integration of self

bookResources

listLesson sequence

  1. Complete the notecard diagnostic

program objective

Write a program that contains a method called printMap that iterates over any Map passed into it and displays the Key/Value pairs. The output of the method in this program that does the iterating must output a List containing all of the values that were looked up before they were printed.

program requirement 1

The incoming Map to the method called printMap must hold String types for both keys and values

The output type for this method must be a List of String objects. The list implementation is up to you

Testing

Test your method by passing in your Expedition map. Then in the calling method, receive the list that the mehod packs up for you and iterate over its values. Prove that the logic works

Package your expedition map into an object called Expedition that contains one member variable called expedMap. Make this member variable private with getters and setters

Post your Expedition object to your github. Update our upload index.

Go retrieve somebody else's Expedition map and test your code!

arrow_upwardback to schedule


Monday, 15 October 2018

Inheritance essentials

live_helpGuiding questions

  • What does the keyword extends do compared with implements?
  • How can the inheritance mechanisms be used to avoid duplicating code?

check_circleLearning Objectives

  • Instantiate a Car object which extends Vehicle and demonstrate the use of inherited member variables and methods
  • Implement the Securable interface on a Car object and show its functions
  • Create another concrete class of the students' choosing
  • Create another interface of the students' choosing and demonstrate its functionality

bookResources

straightenNote card diagnostic

listLesson sequence

  1. Code up and test Vehicle, Car on the class diagrams given
  2. Compose CarLand which instantiates a Car object and manipulates the member variables inherited from its parents.
  3. Implement all the methods in Securable using logical behavior in your your Car blueprint
  4. Build out a new type of Vehicle, this time with methods that implement your chosen API class
  5. You can check the source on our GitHub repo
java class hierarchy

playlist_add_checkSpecification

sendProducts

cakeExtension exercises

arrow_upwardback to schedule


Wednesday, 24 October 2018

Design patterns: presentation versus logic layers

live_helpGuiding questions

  • How can we design software that doesn't need to be completely rewritten when a new user interaction system comes out? (I.e. mobile computing, touch screens, web versus desktop app...)

check_circleLearning Objectives

  • Demonstrate object interactions using both the terminal as display technology and a GUI display system

bookResources

straightenNote card diagnostic

listLesson sequence

  1. Get our simple AWT systems working using Elizabeth and Michael Faux's AWT guide.
  2. Map out the class relationships involved in clicking a button
  3. Diagram logic vs. presentation layer structures
  4. Explore AWT/Swing project specification

sendProducts

Please design a program that meets the following specification

program objective

Demonstrate separation of concerns by writing a program that can interact with your vehicle object using the command line and the GUI

program requirement 1

Create a class that instantiates and then interacts with your custom Vehicle object using the command line

program requirement 2

Adjust your GUI (using AWT or Swing) so that it shows interaction with the object.

cakeExtension exercises

arrow_upwardback to schedule


-->