0 Intro Fall 2021 3
0 Intro Fall 2021 3
0 Intro Fall 2021 3
1
LEARNING OUTCOMES
• Understand what software design is all about and what we will be doing in this
course.
2
WELCOME TO CSC207H1F SOFTWARE DESIGN
3
CS STUFF YOU KNOW FROM FIRST YEAR
From CSC108/148 or CSC110/111:
1. value and type; naming a value; expression
2. list, dictionary, linked list, stack, queue, tree (ADTs)
3. control flow: sequential, if, while, for, function call, return
4. classes and the objects they describe (OOP)
5. recursion
6. computational complexity (big-Oh)
7. unit testing, debugging
4
SOFTWARE DESIGN: COURSE DESCRIPTION
• An introduction to software design and development concepts, methods,
and tools (using a statically-typed object-oriented programming language such
as Java). Topics from
o version control,
o unit testing, refactoring, object-oriented design and development, design patterns,
advanced IDE usage,
o regular expressions, and reflection.
o Representation of floating-point numbers and introduction to numerical computation.
5
MAIN LEARNING OBJECTIVE
• By the end of the course, you will be able to apply professional software design
techniques in a team environment to create and grow an easy-to-read, hard-to-
break, testable, extensible, maintainable, efficient program.
• This is the primary learning objective for this course. Every course topic is
motivated by this and why we have a team project.
• How CSC207 fits into a CSC POSt:
https://courseography.cdf.toronto.edu/graph
6
YOUR JOURNEY
• This course gives you tools to describe, discuss, document, develop, and debug
programs.
• You will experience how programs grow and change, and how these changes
are tracked using version control.
• You’ll practice using fundamental software design terminology that you will
encounter in interviews for summer internships.
• You’ll practice working with other people throughout the term and you’ll work on
a project in a team for much of the course.
7
THE END GOAL
• At the end of the course, you and your team will present your project.
• We’ll explain what we want you to present, give you a template for the
presentation, and help you throughout the term.
• Everyone on the team will speak about part of the design.
8
HOW TO DO WELL IN THIS COURSE
• Have a reason for everything
• Think of the pros and cons before making any decision
• Make sure you can explain to someone else everything you learn
9
PROFESSIONAL SITUATIONS WE ARE TRYING TO
SIMULATE
• Translate a specification for a program into a design and implement it
• Work with a team to implement a complex design
• Give a code review
• Contribute to group decisions by debating the pros and cons of various designs
10
WORKING IN A TEAM
• Imagine you’ve graduated and are working in industry or academia. You are
working in a team on a large project over many months. All of you are
contributing to the same code base, and over time will be editing many different
parts of the project.
o What qualities would you want in the code that everyone contributes? (Remember,
you will have to work with everyone’s code!)
o What skills and behaviours would you want in your team members?
11
Lead or
Sign up to be an RSG Leader now!
Join a
Develop your leadership and facilitation
Recognized skills while learning course materials.
uoft.me/recognizedstudygroups
SUBTOPIC: LEARN AN OBJECT-ORIENTED STATICALLY-
TYPED PROGRAMMING LANGUAGE (JAVA)
• Strong typing
• A memory model for Java (much like Python)
• Inheritance, abstract classes, and interfaces
• Syntax errors vs. runtime errors
• Input and output
• Exception handling
• This will primarily be done outside of lecture through a series of short quizzes, coding
exercises, and reading the extensive Java documentation.
• 207 is not “a course about Java”, it is about software design – we just happen to need
a common language for everyone to program in!
13
SUBTOPIC: DESIGN AND DEVELOPMENT
TECHNIQUES USED PROFESSIONALLY
• How to think about, design, and implement a large program in a team of
programmers
• How to analyze requirements
• How to design code so that it can be easily understood and extended by other
programmers
• Solutions for common coding tasks: design patterns
• How to keep track of changes made to a program (version control using Git)
• An Integrated Development Environment (IntelliJ)
• Unit testing (Junit)
14
FEATURES OF OBJECT-ORIENTED PROGRAMMING
LANGUAGES
• Abstraction — the process of distilling a concept to a set of essential
characteristics.
• Encapsulation — the process of binding together data with methods that
manipulate the data and hiding the internal representation from the user.
o The result of applying abstraction and encapsulation is (often) a class with instance
variables and methods that together model a concept from the real world. (Further
reading: what’s the difference between Abstraction, Encapsulation, and Information
Hiding?) trying to keep everything as private as possible
15
OBJECT-ORIENTED DESIGN CONCEPTS
LOW COUPLING AND HIGH COHESION
• Coupling — how much a class is directly linked to another class.
o High coupling between classes means that changes to one class may lead to changes in
the coupled classes.
o Low coupling is, therefore, a desired goal.
16
OBJECT-ORIENTED DESIGN PRINCIPLES
“SOLID”
• Single responsibility principle: A class should have one, and only one, reason to
change. Speaks to: a class being responsible to ONE actor
• Open/closed principle: Classes should be open for extension but closed for
modification. few changes to the program as we can, but make sure that we can still add new classes with little editing to what’s already there
• Liskov substitution principle: Subclasses should add to a base class’s behaviour,
not replace it.
• Interface segregation principle: Many client-specific interfaces are better than
one general-purpose interface.
• Dependency inversion principle: High-level code shouldn’t depend on low-level
code. Both should depend on abstractions. In addition, abstractions shouldn’t
depend on details.
17
HISTORY OF DESIGN PRINCIPLES
• Industry professionals have, over decades, converged on a set of tips and
techniques for making programs that are easy to read, hard to break,
maintainable, and efficient to program in a team environment.
• We call these design principles.
• There is no rulebook, but software that adheres to as many of these design
principles as possible is generally considered better.
• This is a theme that runs throughout this course.
18
SOFTWARE DESIGN – WHAT IS IT ALL ABOUT?
• First question, why do we write software?
• So, what is the goal of software design?
• [Mentimeter exercise in lecture!] https://www.menti.com/mndouc1nug
19
COURSE TOOLS
• On your computer & in the Teaching Labs
o Programming language: Java
o IDEs: IntelliJ IDEA (and optionally Android Studio)
• Both are JetBrains products – same as PyCharm
o Version control: Git
• Online
o Material for learning Java: Quercus quizzes + GitHub Classroom
o Marking and assignment submission: GitHub Classroom + MarkUs
o Content Quizzes: Quercus quizzes
o Discussion Board: Piazza
20
EXPLORING JAVA
• In your first lab, you will start exploring some Java code with your classmates
and learn the basics of git.
• If there is time in lecture, we’ll open IntelliJ and show some code.
21
HOMEWORK
24