C S 3B: INTERMEDIATE SOFTWARE DESIGN IN PYTHON
Foothill College Course Outline of Record
Heading | Value |
---|---|
Effective Term: | Summer 2023 |
Units: | 4.5 |
Hours: | 4 lecture, 2 laboratory per week (72 total per quarter) |
Prerequisite: | C S 3A. |
Advisory: | Demonstrated proficiency in English by placement via multiple measures OR through an equivalent placement process OR completion of ESLL 125 & ESLL 249. |
Degree & Credit Status: | Degree-Applicable Credit Course |
Foothill GE: | Non-GE |
Transferable: | CSU/UC |
Grade Type: | Letter Grade (Request for Pass/No Pass) |
Repeatability: | Not Repeatable |
Student Learning Outcomes
- A successful student will be able to use the Python environment to define the basic abstract data types (stacks, queues, lists) and iterators of those types to effectively manipulate the data in his or her program.
- A successful student will be able to write and debug Python programs which make use of inheritance, i.e., the "is a" relationship, common to all OOP languages. Specifically, the student will define base and derived classes and use common techniques such as method chaining in his or her programs.
Description
Course Objectives
The student will be able to:
- Configure a Python Development Environment for advanced Python programming
- Use both instance members and class members, as appropriate, in class design
- Analyze and demonstrate the use of multi-dimensional arrays in Python
- Design, implement, and test Python programs that use class inheritance/specialization, and explain why this is an example of the "is-a" relationship
- Demonstrate the use of advanced functional programming
- Explain how guarded code is implemented in Python through exceptions
- Express numbers in decimal, binary, and hexadecimal representations, and use bitwise logical operators to process data at the bit and byte level
- Demonstrate a working knowledge of basic abstract data types and their Python-based collection classes
- Produce end-user programs which feature event-driven techniques and multi-threading to provide a sensible and easy-to-use GUI
- Explain what a Python abstract base class (ABC) is and how it is used
- Describe declaration models for run-time storage allocation, garbage collection, and type checking, and compare with other languages like C++ or Java
- Use some of the Python collections to write efficient and portable application programs
- Write to and read from files using intermediate file I/O operations in a Python program
- Design, implement, test, and debug intermediate-level Python programs that use each of the following fundamental programming constructs: string processing, numeric computation, simple I/O, arrays, and the Python API
- Write applications that solve problems in one or more application area: mathematics, physics, chemistry, cellular automata, 3-D simulation, astronomy, biology, business, internet
Course Content
- Setting up a complete Python environment
- Using the Python.org website
- Configuring the PATH and other environment variables
- The proper use of class and instances members and methods
- Class attributes
- Instance attributes
- Scope and namespace usage of class and instance attributes
- Modules vs. classes
- Comparison of instance, class, and static methods
- Deep vs. shallow copies with copy() and deepcopy()
- Operator overloading
- Multi-dimensional arrays and the NumPy Module
- Multi-dimensional arrays using lists of list
- Multi-dimensional arrays using NumPy
- Limitations of Python array class
- List iterators vs. explicit index values
- Binary searching as a logarithmic time complexity example of recursion
- Inheritance
- The "is a" relationship
- Extending existing base classes
- Derived classes (subclasses) and class hierarchy
- Member method overriding
- Intended private, public, and default members
- Encapsulation and Polymorphism
- Advanced OOP
- Constructor chaining
- Member method chaining
- Key (named) parameters
- Error handling and event-driven programming
- Built-in Python exception objects
- Custom exception declarations
- Manually raising exceptions
- Alternatives to exceptions
- Non-decimal arithmetic and related types
- Bitwise numeric operators
- Bitwise logical operators
- Binary and hexadecimal constants
- Enum types (int and non-int)
- Container datatypes
- Abstract Data Types (ADTs) and Python Collections
- List-like, dict-like, and wrapper containers
- The vector and linked-list ADT and Python's deque objects
- The "hash-able" ADT and Python's Counter objects
- Implementing ADTs through inheritance
- Topics in Graphical User Interfaces (GUI) and multi-threading
- GUI through Tkinter module
- Tkinter widgets (message, button, label, text, canvas)
- Layout options (pack, grid)
- Event handlers: built-in vs. custom
- Multi-threaded using the Python threading.py library
- Abstract Base Classes (ABCs)
- Metaclass for defining ABCs
- Defining and using interfaces
- Storage allocation models and typing in Python
- Python memory management, symbol tables, and execution model
- Run time object binding and storage management of activation records in Python
- Binding, visibility, persistence, and lifetime of variables
- Strong typing vs. dynamic typing
- Duck typing vs. isinstance() and hasattr()
- Specifics of Python Collections
- The namedtuple() method
- Deque used to implement queue and stack
- Counter for rapid tallies
- Defaultdict for key-value pairs and lists
- Topics in Python file I/O
- Output formatting
- File objects
- JSON use in Python
- Essential examples and assignment areas in Python
- String/text processing
- Numeric computation
- User interaction
- Multi-class projects and compound data types
- Inheritance-based projects
- Representative GUI and/or threaded project with event-driven design
- Applications used throughout course in selected areas
- Math
- Physics
- Chemistry
- Biology
- Astronomy
- Business and finance
- Internet
Lab Content
- Familiarization with the intermediate-level online development environment
- Modify and customize the environment variables that affect the Python installation
- Create multi-file programming projects
- Gain experience with the steps needed to edit a complex program
- Modify editor settings to produce an industry standard code style
- Organizing and debugging multi-class projects
- Demonstrate the ability to debug programs that contain multiple classes
- Distinguish between interface and implementation in projects by creating classes that are independent of I/O modality
- Write individual component classes that are independent of client use and can serve several client programs
- Emulate symbolic constants by not providing setters
- Implement static and instance members into classes in a way that demonstrates a mature understanding of object-oriented programming (OOP) in a lab project
- Exploring advanced array constructs in class design
- Gain experience in effectively using single and multi-dimensional arrays as class members
- Apply nested loops to process multi-dimensional arrays
- Use the Python environment to debug errors in multi-dimensional arrays
- Solve problems using fixed-size and dynamic sized arrays, as appropriate
- Demonstrating competence in intermediate level algorithm design using classes within the Python environment
- Use Python tools and text editors to implement a multi-faceted algorithm and/or simulation that makes effective use of OOP
- Evaluate and comment on other students' algorithms
- Utilize a combination of string processing and numeric processing to address various aspects of the algorithm implementation
- Produce clear program runs which demonstrate that the algorithm addresses a variety of cases and/or input states
- Incorporate bitwise and logical operations to address binary logic tasks within an algorithm
- Building a program that uses class inheritance to demonstrate how re-use is handled in OOP
- Create a project that contains at least one class intended to be used as a base class
- Derive (sub-class) one or more classes from the base class
- Use method overriding to avoid code duplication between base classes and derived classes
- Incorporating basic abstract data types in programming projects
- Implement a fundamental abstract data type (ADT), such as a queue or stack in a programming lab
- Use a previously written ADT from the Python's collection application programmer interface (API)
- Incorporate inheritance in a project that uses ADTs
- Provide a client program that tests and demonstrates the correct behavior of the ADT
- The proper use of modules and classes, in conjunction with inheritance and other advanced techniques learned in previous labs
- Create the proper set of methods within a class that enables an object to be copied deeply
- Utilize inheritance to reinforce the segregation of data into base- and derived-level behavior
- Utilize at least one other lab concept, such as binary logic or multi-dimensional arrays, to further improve integration of intermediate concepts
- Separate I/O and data storage in advanced programs
- Building projects that make effective use of Python's duck typing
- Demonstrate the difference between deriving from a base class and specializing using duck typing
- Practice using a duck typed method or class by invoking the method with different client types and test that the duck typing is working as expected
- Use duck typing to exercise some aspect of ADTs, such as specializing a generic ADT to make its behavior specific to an assigned project specification
- Employ debugging techniques to solve problems that arise when designing with duck typing
- Exception handling and file I/O in programming
- Write a class that has methods which use exception handling to report errors to the client
- Write a test client that uses a try/except template to detect exceptions
- Implement an algorithm or simulation that reads from and/or writes to external files
- Demonstrate various ways that exceptions are handled and reported besides exception objects being raised and excepted
Special Facilities and/or Equipment
2. Website or course management system with an assignment posting component (through which all lab assignments are to be submitted) and a forum component (where students can discuss course material and receive help from the instructor). This applies to all sections, including on-campus (i.e., face-to-face) offerings.
3. When taught via Foothill Global Access on the internet, the college will provide a fully functional and maintained course management system through which the instructor and students can interact.
4. When taught via Foothill Global Access on the internet, students must have currently existing email accounts and ongoing access to computers with internet capabilities.
Method(s) of Evaluation
Tests and quizzes
Written laboratory assignments which include source code, sample runs, and documentation
Final examination
Method(s) of Instruction
Lectures which include motivation for syntax and use of the Python language and OOP concepts, example programs, and analysis of these programs
Online labs (for all sections, including those meeting face-to-face/on-campus), consisting of:
1. A programming assignment webpage located on a college-hosted course management system or other department-approved internet environment. Here, the students will review the specification of each programming assignment and submit their completed lab work
2. A discussion webpage located on a college-hosted course management system or other department-approved internet environment. Here, students can request assistance from the instructor and interact publicly with other class members
Detailed review of programming assignments which includes model solutions and specific comments on the student submissions
In-person or online discussion which engages students and instructor in an ongoing dialog pertaining to all aspects of designing, implementing, and analyzing programs
When course is taught fully online:
1. Instructor-authored lecture materials, handouts, syllabus, assignments, tests, and other relevant course material will be delivered through a college-hosted course management system or other department-approved internet environment
2. Additional instructional guidelines for this course are listed in the attached addendum of CS department online practices
Representative Text(s) and Other Materials
Ramalho, Luciano. Fluent Python. 2022.
Downey, Allen. Think Python, 2nd ed.. 2020.
Types and/or Examples of Required Reading, Writing, and Outside of Class Assignments
- Reading
- Textbook assigned reading averaging 30 pages per week
- Reading the supplied handouts and modules averaging 10 pages per week
- Reading online resources as directed by instructor though links pertinent to programming
- Reading library and reference material directed by instructor through course handouts
- Writing
- Writing technical prose documentation that supports and describes the programs that are submitted for grades