180 likes | 290 Views
CIT241. Prerequisite Knowledge Variables Operators C++ Syntax Program Structure Classes Basic Structure of a class Concept of Data Hiding Concept of Inheritance Concept of Polymorphism. CIT241 Objectives. Study of data structures and algorithms Use of STL and possibly Boost libraries
E N D
CIT241 • Prerequisite Knowledge • Variables • Operators • C++ Syntax • Program Structure • Classes • Basic Structure of a class • Concept of Data Hiding • Concept of Inheritance • Concept of Polymorphism
CIT241 Objectives • Study of data structures and algorithms • Use of STL and possibly Boost libraries • Containers • Iterators • Algorithms • Searching • Sorting • Other
Software Design • Software Life Cycle • Analysis – the What • Design – the How • Implementation – the Code • Testing and debugging – the Quality
Design Methodologies • Structured design • Waterfall methodology • Data Flow Diagrams, Structure Charts, HIPO diagrams, Pseudo Code • Functional decomposition • Object-Oriented design • Iterative and Incremental design • UML – use cases, class diagrams, sequence charts, state diagrams, packages • Object decomposition
Agile Methodologies • Do only what is necessary • Capture requirements at a high level • Develop small, incremental releases and iterate • Write tests before code • Refactor code
Algorithms • More than one approach • Deals with trade-offs • Memory space • Processing time • Simplicity of code • Study of Data Structures and Algorithms • Containers • Functions • Searching and Sorting
Big-O Notation • Efficiency of an algorithm • Interested in asymptotic behavior • Especially as it approaches infinity • Measure number of operations • How does number of operations grow as number of elements grow
Searching • Linear search • Binary search • Cost of two methods • Frequency of adding new element • Frequency of searching for an element
Classes and Objects • Class represents a type of object • Extensible programming language • Encapsulates state and behavior • Reusable • Classes used to model problem • Objects are the instances • Data members represent current state • Behavior is shared by all objects of a class
Determining Classes • Problem Domain • Vision • Use cases or scenarios • Nouns as potential classes • CRC cards • Responsibility • Sequence diagrams • Actor interacting with Interface class(es) • Interface class interacting with domain classes
Relationships between Classes • Has a – composition • Is a – inheritance • Uses – association • Relationships have multiplicity • 1 – 1 • 1 – Many • Many – Many • Many(s) in model most often held in container
Class • Data members • Fields • Static Field • Member functions • Accessors and mutators • Standard C++ does not support properties • Implements get and set functions • Static member functions • Accessibility • Private • Protected • Public
Class Methods • Constructors • Constructors with default parameters • Destructor • Public • Private • Built-in Operations • member access (.) or (->) for dynamic objects • assignment (=)
Patterns • Model/View/Controller - Separation of concerns • Data part • Presentation part • Data Persistence • Separate data from storing/retrieving of data
Date Class • How is it going to be used? • Methods • Constructors • Destructor? • Set/Get functions • Calculation functions • Formatting functions
NetFlix Like Project • Problem Statement We want to establish a service that permits a customer to enroll into one of three plans. The first plan allows the customer to have 2 videos out at a time. The second plan allows the customer to have 3 videos out at a time but can also download 10 videos per month. The third plan allows the customer to have 5 videos out at a time and can download 30 videos per month. The customer keeps a list of desired videos. He can add videos to the list, resequence the videos on the list, remove videos from the list. When a video is returned, the system will find the next available item on the customer’s list and mail out the video. The system needs to keep track of videos sent to the customer. The customer can ask the system to list all the videos the customer has received, returned, or downloaded. The system needs to track customers who has not yet reached the number of videos permitted out at a time so when a new batch of returned videos is registered with the system, the system can find a customer that is waiting for one of the returned videos.
Project 1 • Simple ToDoList Application Need to capture an activity that has a description and a planned completion date. Need to have the ability to add an increment to the date for an activity. The increment can be both negative and positive. We would also like to capture the difference between two date values. We need to record the actual completion date element for an activity as well as its planned completion date value.