Download presentation
Presentation is loading. Please wait.
Published byTyrone Tucker Modified over 9 years ago
1
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
2
CIT241 Objectives Study of data structures and algorithms Use of STL and possibly Boost libraries ◦ Containers ◦ Iterators ◦ Algorithms Searching Sorting Other
3
Software Design Software Life Cycle ◦ Analysis – the What ◦ Design – the How ◦ Implementation – the Code ◦ Testing and debugging – the Quality
4
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
5
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
6
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
7
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
8
Growth Rates nlog 2 nn log 2 nn2n2 2n2n 10012 21224 42816 832464256 1646425665,536 32516010244,294,967,296
9
Searching Linear search Binary search Cost of two methods ◦ Frequency of adding new element ◦ Frequency of searching for an element
10
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
11
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
12
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
13
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
14
Class Methods Constructors ◦ Constructors with default parameters Destructor Public Private Built-in Operations ◦ member access (.) or (->) for dynamic objects ◦ assignment (=)
15
Patterns Model/View/Controller - Separation of concerns ◦ Data part ◦ Presentation part Data Persistence ◦ Separate data from storing/retrieving of data
16
Date Class How is it going to be used? Methods ◦ Constructors ◦ Destructor? ◦ Set/Get functions ◦ Calculation functions ◦ Formatting functions
17
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.
18
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.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.