Tips for COMP301

Foundations of Programming

Be sure to start assignments early and to go to office hours early and regularly. Be sure to practice and experiment with code. Take notes of the information.

The below is taken from Professor KMP's syllabus.

Content

  • Java Workflow, Build Automation (Maven)
  • Source Control (Git)
  • Object-Oriented Programming in Java
  • Encapsulation
  • Inheritance
  • Subtype Polymorphism
  • Overriding, Overloading, Virtual Methods
  • Abstractions, Composition over Inheritance, Abstract Classes
  • Dependency Injection, Loose Coupling, inversion of control
  • Early error handling approaches, throwing and catching exceptions
  • Finally block, nested throw/catch, programmer-defined exceptions, checked and unchecked exceptions catch or specify, run time, and compile time.
  • Test-driven design, unit testing with JUnit
  • Iterator design pattern
  • Decorator design pattern, delegation
  • Strategy, Singleton / Multiton, and Factory design patterns
  • Observer design pattern
  • Anonymous classes, lambda expressions
  • User Interfaces
  • JavaFX
  • Model-view-controller
  • Asynchronous programming, threads
  • Race conditions, mutual exclusion, locks, deadlock

Learning Objectives

A student successfully completing COMP 301 will be able to (by category):

  • Object-Oriented Programming
    • Define encapsulation, describe its purpose, and demonstrate it in an object-oriented context
    • Define inheritance, describe its tradeoffs, and demonstrate it in an object-oriented context
    • Define aggregation, composition, and delegation, compare them to inheritance, and give examples of each
    • Describe the “composition over inheritance” rule-of-thumb
    • Explain the benefits of programming to an interface
    • Define polymorphism, give examples using object-oriented code, and describe when to use it successfully
    • Explain the difference between overriding and overloading
    • Explain the difference between a concrete and an abstract class
  • Errors and Exception
    • Explain the difference between run-time and compile-time errors, and give examples of each
    • Describe Java's exception hierarchy for run-time errors
    • Throw and catch Java exceptions effectively
    • Identify situations where throwing an exception is appropriate
    • Explain the anatomy of a stack trace error, and demonstrate how it can be used to infer the cause of the crash
  • Software Testing
    • Describe the importance of tests for writing production-quality code as part of a developer team
    • Organize tests for functions, methods, classes, and modules
    • Define the 4 phases of testing
    • Describe how dependency injection can simplify testing
    • Write unit tests to verify that a given algorithm meets its specification
  • Design Patterns
    • Describe what design patterns are, how they are helpful, and when to use them
    • Define each of the following design patterns, describe what problem it solves, and show how it can be implemented
      • Iterator pattern
      • Decorator pattern
      • Factory pattern
      • Singleton pattern
      • Observer pattern
  • Asynchronous Programming Model
    • Explain the difference between synchronous and asynchronous models for programming
    • Describe some challenges introduced by an asynchronous model
    • Explain the difference between concurrent and parallel execution
    • Explain the difference between a process and a thread
    • Define deadlock and explain how it can occur
    • Define race conditions and explain how they can occur
    • Explain how mutexes/semaphores/locks can be used as strategies for preventing race conditions
    • Program concurrently in Java using the Runnable and Thread interfaces
    • Use the synchronized keyword in Java to implement a mutex and prevent race conditions
  • User Interfaces
    • Discuss the qualities of an effective user interface
    • Explain the similarities and differences between a CLI and a GUI
    • Describe the model-view-controller paradigm and explain how the three elements interact in response to user input or program state changes
    • Build a GUI with JavaFX using the model-view-controller paradigm
  • Professional Software Development
    • Explain what an API is and discuss the qualities of effective API design
    • Discuss the tradeoffs of relying on dependencies and APIs
    • Highlight the importance of writing documentation
    • Use the terms cohesion and coupling to describe module design
    • Use git effectively for version control, including branch management and resolving merge conflicts
    • Use Maven effectively for dependency management and build automation in Java
    • Define inversion of control
    • Discuss the trade-offs of using a framework to structure code

Check the Study Strategy.

Support the Author

Donate to the Author