Karteikarten
COMP 206 Unit 1: Introduction to Objects
Karten in diesem Stapel (60)
- 1solution space-machine model
-place where you're modeling that problem - 2problem space-model of problem that is actually being solved
-place where problem exists - 3object-elements in problem space and their representations in solution space
-can represent real-life objects or abstract concepts - 4data abstraction-reduction of particular body of data to simplified representation of the whole
-creation of well-defined interface for object - 55 characteristics of OOP1. everything is an object
2. program is bunch of objects telling each other what to do
3. each object has its own memory made up of other objects
4. every object has type
5. all objects of particular type can receive same messages - 6Programming language used to create 5 characteristics of OOP-Smalltalk
-first successful object-oriented language upon which C++ is based - 7class-group of objects that are identical except for state during program's execution
-describes form and behavior of objects - 8type-defines properties and behaviors shared by all objects of same type
-class is data type because floating point number also has set of characteristics and behaviors - 9interfaceestablishes what requests you can make for a particular object
- 10Relationships between interface, type, class, and object-type determines interface
-class is particular implementation of interface
-type has function associated with request; when request is made to object, function is called - 11access specifiersdetermine who can use definitions that follow
- 12publicfollowing definitions are available to everyone
- 13privateno one can access definitions except you
- 14protected-acts like private
-inheriting class has access to protected members, but not private members - 15class creatorcreate new data type
- 16client programmerclass consumers who use data types in applications
- 17Relationship between class creator and client programmer-client programmer collects classes to use for application development
-class creator builds class that exposes only what's necessary to client programmers - 18hidden implementationinsides of object that can be easily corrupted by client programmers
- 19Relationship between hidden implementation, class creator, and client programmer-access control keeps client programmers away from portions they shouldn't touch
-access control allows library designer to change internal workings of class without affecting client programmer - 20reuse of codetakes experience and insight to produce good design
- 21creating member objectplace object of class inside new class
- 22inheritance-take existing class, clone it, and make additions and modifications to clone
-allows abstraction to reuse not only implementation but also interface of another abstraction - 23composition-class made up of any number and type of other objects
-child class depends on parent for existence - 24aggregationclass made up of other existing classes that may exist independent of child class
- 25base/parent/super classclass from which other classes are derived
- 26inherited/sub/child classclass which inherits members of another class
- 27base typecontains all characteristics/behaviors that are shared among types derived from it
- 28new typecontains all members of existing type but more importantly it duplicates interface of base class
- 29is-a relationshipone class is sub-type of another class
- 30is-like-a relationship-new type has interface of old type but also contains other functions
-new type can be substituted for base type but new functions are not accessible from base type - 31early bindinginformation needed to call function is known at compile time
- 32late bindingcode being called isn't determined until runtime
- 33virtual (keyword)provides flexibility of late-binding properties for function
- 34upcastingprocess of treating derived type as though it were its base type
- 35static storage areafixed path of memory that is allocated before program begins to run
- 36stack-area in memory that is used directly by microprocessor to store data during program execution
-linear data structure - 37dynamic storage areapatch of memory that is allocated while program is running
- 38heap-way to organize elements of range that allows for fast retrieval of element while allowing for fast insertion of new elements
-hierarchical data structure - 39delete (keyword)-perform destruction of object in heap
- 40garbage collectorautomatically discovers when object is no longer in use and destroys it
- 41exceptionproblem that arises during execution of program
- 42exception handlingwires error directly in programming language sometimes even OS
- 43throw-used to communicate information about error
-used when we explicitly want exception to occur - 44catchcatch error and handle exception condition
- 455 phases of designPhase 1: creating requirements analysis and system specification; incorporates mission statement
Phase 2: come up with design
Phase 3: implement system architecture
Phase 4: iterate use cases; have integrated, tested system
Phase 5: evolution/maintenance - 46mission statementfundamental purpose, business that it's in, basic need that it satisfies
- 47role of mission statementsets tone for project
- 485 stages of object design1. object discovery
2. object assembly
3. system construction
4. system extension
5. object reuse - 49Questions discussed in Phase 1Who will use system?
What can those actors do with system?
How does actor do something with system?
How else might this work if someone else were doing this, or if same actor had different objective?
What problems might happen while doing something with system? - 503 attributes of class developed in Phase 21. name of class
2. responsibilities of class
3. collaborations of class - 51Benefits of planning and design-things fall together more easily
-program is easier to build and debug
-program is easier to understand and maintain - 522 key attributes of extreme programming (XP)-write tests first
-pair programming - 53writing tests firsts (pros)-clear definition of interface of class
-gives you half of testing performed by compiler
-tests are extension of safety net provided by language
-make big projects without throwing project into disarray - 54writing tests firsts (cons)-slow process
-tests must be maintained when requirements change
-challenge to learn - 55pair programming-one person codes, one person thinks about programs
-thinker keeps big picture in mind - 56pair programming (pros)-if coder gets stuck, swap places
-if both get stuck, someone else in work area can help
-keeps things flowing and on track
-makes programming social and fun
-fewer mistakes/bugs
-increased code quality
-faster training - 57pair programming (costs)-higher costs
-not sustainable to be practices all of the time - 58benefits of C++1. closed holes in C language
2. extension of C; not new syntax and programming model
3. increased efficiency
4. systems easier to express and understand
5. maximal leverage with libraries
6. source-code reuse with templates
7. error handling
8. erase creeping complexity boundaries between small and large programs - 595 guidelines when transitioning to C++1. training
2. low-risk project
3. model from success
4. use existing class libraries
5. don't rewrite existing code in C++ - 603 common management obstacles to using C++1. startup costs
2. performance issues
3. common design errors
Informationen
- Beschreibung
- University-level C++ COMP 206 Karteikarten am COMP 206 Unit 1: Introduction to Objects, erstellt von Adriana Vincelli-Joma am 28/05/2021.
- Erstellt von
- Adriana Vincelli-Joma
- Aufrufe
- 0
- Bewertung