C S 3B: INTERMEDIATE SOFTWARE DESIGN IN PYTHON
Foothill College Course Outline of Record
|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|
|Grade Type:||Letter Grade (Request for Pass/No Pass)|
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.
The student will be able to:
A. Configure a Python Development Environment for advanced Python programming.
B. Use both instance members and class members, as appropriate, in class design.
C. Analyze and demonstrate the use of multi-dimensional arrays in Python.
D. Design, implement, and test Python programs that use class inheritance/specialization, and explain why this is an example of the “is-a” relationship.
E. Demonstrate the use of advanced functional programming.
F. Explain how guarded code is implemented in Python through exceptions.
G. Express numbers in decimal, binary and hexadecimal representations and use bitwise logical operators to process data at the bit and byte level.
H. Demonstrate a working knowledge of basic abstract data types and their Python-based collection classes.
I. Produce end-user programs which feature event-driven techniques and multi-threading to provide a sensible and easy-to-use GUI.
J. Explain what a Python abstract base class (ABC) is and how it is used.
K. Describe declaration models for run-time storage allocation, garbage collection and type checking and compare with other languages like C++ or Java.
L. Use some of the Python collections to write efficient and portable application programs.
M. Write to and read from files using intermediate file I/O operations in a Python program.
N. 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.
O. Write applications that solve problems in one or more application area: mathematics, physics, chemistry, cellular automata, 3-D simulation, astronomy, biology, business, Internet.
A. Setting up a complete Python environment
1. Using the Python.org website
2. Configuring the PATH and other environment variables
B. The proper use of class and instances members and methods
1. Class attributes
2. Instance attributes
3. Scope and namespace usage of class and instance attributes
4. Modules vs. classes
5. Comparison of instance, class and static methods
6. Deep vs. shallow copies with copy() and deepcopy()
7. Operator overloading
C. Multi-dimensional arrays and the NumPy Module
1. Multi-dimensional arrays using lists of list
2. Multi-dimensional arrays using NumPy
3. Limitations of Python array class
4. List iterators vs. explicit index values
5. Binary searching as a logarithmic time complexity example of recursion
1. The "is a" relationship
2. Extending existing base classes
3. Derived classes (subclasses) and class hierarchy
4. Member method overriding
5. Intended private, public and default members
6. Encapsulation and Polymorphism
E. Advanced OOP
1. Constructor chaining
2. Member method chaining
3. Key (named) parameters
F. Error handling and event-driven programming
1. Built-in Python exception objects
2. Custom exception declarations
3. Manually raising exceptions
4. Alternatives to exceptions
G. Non-decimal arithmetic and related types
1. Bitwise numeric operators
2. Bitwise logical operators
3. Binary and hexadecimal constants
4. Enum types (int and non-int)
H. Container datatypes
1. Abstract Data Types (ADTs) and Python Collections
2. List-like, dict-like and wrapper containers
3. The vector and linked-list ADT and Python's deque objects
4. The “hash-able” ADT and Python's Counter objects
5. Implementing ADTs through inheritance
I. Topics in Graphical User Interfaces (GUI) and multi-threading
1. GUI through Tkinter module
2. Tkinter widgets (message, button, label, text, canvas)
3. Layout options (pack, grid)
4. Event handlers: built-in vs. custom
5. Multi-threaded using the Python threading.py library
J. Abstract Base Classes (ABCs)
1. Metaclass for defining ABCs
2. Defining and using interfaces
K. Storage allocation models and typing in Python
1. Python memory management, symbol tables and execution model
2. Run time object binding and storage management of activation records in Python
3. Binding, visibility, persistence and lifetime of variables
4. Strong typing vs. dynamic typing
5. Duck typing vs. isinstance() and hasattr()
L. Specifics of Python Collections
1. The namedtuple() method
2. Deque used to implement queue and stack
3. Counter for rapid tallies
4. Defaultdict for key-value pairs and lists
M. Topics in Python file I/O
1. Output formatting
2. File objects
3. JSON use in Python
N. Essential examples and assignment areas in Python
1. String/text processing
2. Numeric computation
3. User interaction
4. Multi-class projects and compound data types
5. Inheritance-based projects
6. Representative GUI and/or threaded project with event-driven design
O. Applications used throughout course in selected areas
6. Business and finance
A. Familiarization with the intermediate-level online development environment.
1. Modify and customize the environment variables that affect the Python installation.
2. Create multi-file programming projects.
3. Gain experience with the steps needed to edit a complex program.
4. Modify editor settings to produce an industry standard code style.
B. Organizing and debugging multi-class projects.
1. Demonstrate the ability to debug programs that contain multiple classes.
2. Distinguish between interface and implementation in projects by creating classes that are independent of I/O modality.
3. Write individual component classes that are independent of client use and can serve several client programs.
4. Emulate symbolic constants by not providing setters.
5. Implement static and instance members into classes in a way that demonstrates a mature understanding of object-oriented programming (OOP) in a lab project.
C. Exploring advanced array constructs in class design.
1. Gain experience in effectively using single and multi-dimensional arrays as class members.
2. Apply nested loops to process multi-dimensional arrays.
3. Use the Python environment to debug errors in multi-dimensional arrays.
4. Solve problems using fixed-size and dynamic sized arrays, as appropriate.
D. Demonstrating competence in intermediate level algorithm design using classes within the Python environment.
1. Use Python tools and text editors to implement a multi-faceted algorithm and/or simulation that makes effective use of OOP.
2. Evaluate and comment on other students' algorithms.
3. Utilize a combination of string processing and numeric processing to address various aspects of the algorithm implementation.
4. Produce clear program runs which demonstrate that the algorithm addresses a variety of cases and/or input states.
5. Incorporate bitwise and logical operations to address binary logic tasks within an algorithm.
E. Building a program that uses class inheritance to demonstrate how re-use is handled in OOP.
1. Create a project that contains at least one class intended to be used as a base class.
2. Derive (sub-class) one or more classes from the base class.
3. Use method overriding to avoid code duplication between base classes and derived classes.
F. Incorporating basic abstract data types in programming projects.
1. Implement a fundamental abstract data type (ADT), such as a queue or stack in a programming lab.
2. Use a previously written ADT from the Python's collection application programmer interface (API).
3. Incorporate inheritance in a project that uses ADTs.
4. Provide a client program that tests and demonstrates the correct behavior of the ADT.
G. The proper use of modules and classes, in conjunction with inheritance and other advanced techniques learned in previous labs.
1. Create the proper set of methods within a class that enables an object to be copied deeply.
2. Utilize inheritance to reinforce the segregation of data into base- and derived-level behavior.
3. Utilize at least one other lab concept, such as binary logic or multi-dimensional arrays, to further improve integration of intermediate concepts.
4. Separate I/O and data storage in advanced programs.
H. Building projects that make effective use of Python's duck typing.
1. Demonstrate the difference between deriving from a base class and specializing using duck typing.
2. 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.
3. 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.
4. Employ debugging techniques to solve problems that arise when designing with duck typing.
I. Exception handling and file I/O in programming.
1. Write a class that has methods which use exception handling to report errors to the client.
2. Write a test client that uses a try/except template to detect exceptions.
3. Implement an algorithm or simulation that reads from and/or writes to external files.
4. Demonstrate various ways that exceptions are handled and reported besides exception objects being raised and excepted.
Special Facilities and/or Equipment
B. 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.
C. 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.
D. 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
A. Tests and quizzes
B. Written laboratory assignments which include source code, sample runs and documentation
C. Final examination
Method(s) of Instruction
A. Lectures which include motivation for syntax and use of the Python language and OOP concepts, example programs, and analysis of these programs.
B. 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.
C. Detailed review of programming assignments which includes model solutions and specific comments on the student submissions.
D. In person or online discussion which engages students and instructor in an ongoing dialog pertaining to all aspects of designing, implementing and analyzing programs.
E. 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. O'Reilly, 2015.
Harrison, Matt. Intermediate Python Programming. CreateSpace Independent Publishing, 2013.
Types and/or Examples of Required Reading, Writing, and Outside of Class Assignments
1. Textbook assigned reading averaging 30 pages per week
2. Reading the supplied handouts and modules averaging 10 pages per week
3. Reading online resources as directed by instructor though links pertinent to programming
4. Reading library and reference material directed by instructor through course handouts
1. Writing technical prose documentation that supports and describes the programs that are submitted for grades