1/103
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Object Oriented Programing
It is a programming paradigm that revolves around the use of objects
It organizes code into objects that combine data and behavior, making problems easier to understand and maintain
Data type
it is a collection of values that share common properties and a purpose in a program
Abstract data type
It focuses on what operations are allowed on the data, not how the data is stored internally
Examples are stack, natural numbers, booleans
Precondition
It is when an operation called, certain condition must already be true before it runs
Postcondition
It is when an operation is called, after it runs, it must guarantee a valid result
Modularity
It means breaking a program into separate, manageable parts called modules
Procedural Modularity
A type of modularity that is organized around functions or procedures
It is fine grained and low level
It is also not enough for large scale systems on its own
Boxing Modularity
This type of modularity groups code behind clear boundaries
Visibility can be controlled using imports and exports
Flexible in size and structure
Data Centered Modularity
it is a type of modularity that is built around data that represents one clear concept
It is closely tied to abstract data types
It is common in object oriented design
Reusability
It means building software in a way that lets us reuse code that is already written, tested, and documented
Method lookup
It is when an object receives a message and selects the most appropriate operation to handle it
Class
It is an organizational unit of an Object Oriented design and program
These are user-defined data types that acts as the blueprint for individual objects, attributes and methods.
state
Describes the properties or data an object holds and usually expressed as nouns
Behavior
Describes the actions an object can perform and usually expressed as verbs
Phenomenon
It is a specific thing that exists, either in the real world or in the mind
They become objects in OOP
Concept
It is a generalized idea formed by grouping similar phenomena based on shared properties
They become Classes in OOP
Name, Intension, Extension
Three parts of concept
Name
It is the label we use to refer to the concept
Intension
It is the set of properties that define what the concept is
Extension
It is the collection of phenomena that belong to the concept
Aristotelian View
It is a way to understand concept and it states that “concepts have clear defining properties. An object either belongs or does not belong to the concept”
Fuzzy View
It is another way to understand concepts and it states that “concepts are based on typical examples. Boundaries are not always clear”
Classification
It is to create a concept by grouping similar phenomena
It starts from many phenomena
Forms a single concept
Uses shared defining properties
Exemplification
It is to focus on a specific phenomenon that belongs to a concept
It starts from a concept
It identifies concrete examples
Selects phenomena within that concept
Aggregation, Decomposition
Two ways of forming new concepts from existing ones based on parts and wholes
Aggregation
it builds a concept by combining parts
Focuses on the whole
Parts exists independently
Decomposition
Breaks concepts into parts
Focuses on the structure
Reveals what the whole is made of
Generalization, Specialization
Ways to form new concepts from existing ones by changing how broad or specific they are
Generalization
Forms a broader concept
Combines shared properties
Moves upward in the hierarchy
Specialization
Forms a narrower concept
Adds or restricts properties
Moves downward in the hierarchy
Object
It is an instance of a class
It is a runtime entity that combines data and behavior defined by its class
They are created based on the blue prints provided by the class
Attributes
It is a piece of data that is associated with a particular class or object
They represent the state of an object and describe its characteristics or properties
Method
These are functions inside the class that perform certain actions
Set of instructions grouped together within a code block
Encapsulation, Inheritance, Polymorphism, Abstraction
Main Principles of OOP
Encapsulation
This is a principle of OOP that states that all important information is contained inside an object and only selected information is exposed
Abstraction
It is the process of hiding unnecessary information from a user while displaying essential information that is valuable to them
Inheritance
Classes can reuse code from other classes. Relationships and subclasses between objects can be assigned, enabling developers to reuse common logic while still maintaining a unique hierarchy
This property of OOP forces a more thorough data analysis, reduces development time and ensure a higher level of accuracy
Polymorphism
Many forms
Objects are assigned to share behaviors and they can take on more than one form
the program will determine which meaning or usage is necessary for each execution of that object from a parent class, reducing the need to duplicate code.
This principle of OOP allows different types of objects to pass through the same interface
C#
it is a beginner-friendly, object-oriented programming language that has a strong industry demand and can be scaled for large systems
It runs on .NET framework and executes languages by compiling them and converting them into machine-readable code
C# statements
It can consist of a single line of code that ends in a semi-colon, or a series of single-line statements in a block that is enclosed in curly brackets
Constants
These are immutable values which are known at compile time and do not change for the life of the program
Message Passing
A runtime behavior in OOP
It is when objects communicate through function calls
Action
Are usually implemented as procedure or function calls
Always directed at an object
May take parameters
Triggered by Messages
Class, Object, Attributes, Methods
Structure of OOP
Data Hiding
it is when objects protect their internal data, improving security and control
High cohesion
A characteristics of a good class where the class represents one clear and useful concept and does that job well
Low coupling
It is a quality of a good class where a class interacts with other classes only when necessary to do its job
main()
Entry point of a C# program
Reduced complexity
This is a benefit of OOP where large problems are broken down into smaller objects, each with a clear responsibilty
Modifiability
It is a benefit of OOP where internal changes inside a class do not affect other parts of the program
{}
Markers of the beginning and the end of a chuck of C# code
Using
It is used to import namespaces and use classes of it
Namespace
It is used to organize codes
A container for classes and other namespaces
;
Used to terminated a C# statement
Declaration statement
this introduces a new variable or constant
It can optionally assign a value to a variable
Method Signature
It consists of the name of the method and any method parameters
Math.Abs()
Returns the absolute value of a number
Math.Pow()
Calculates a number raised to the power of another number
Math.Sqrt()
Returns the square root of a number.
Math.Round()
Rounds a decimal number to the nearest integer.
String.Length()
Returns the length of a string
String.ToUpper
Converts a string to uppercase
String.ToLower
Converts a string to lowercase
String.Concat()
Concatenates two or more strings.
Equals()
Used to make comparisons between two strings
String.Substring()
Extracts a substring from a string based on the specified start index and length
Custom Method
It is a user-defined method that contains specific set of code instructions
Must be declared within a class or struct
Method Overloading
this allows you to define multiple methods with the same name but different parameter lists within the same class.
Modifiers
controls the access levels and visibility of class members (fields, properties, methods, etc.)
Public, Private, Protected, Internal
Commonly used modifiers
Private
The code is only accessible within the same class
Public
The code is accessible for all classes
Protected
The code is accessible within the same class, or in a class that is inherited from that class.
Internal
The code is only accessible within its own assembly, but not from another assembly.
Method
in programming refers to a set of instructions grouped together within a code block.
Main method
serves as the starting point for any C# program and is initiated by the common language runtime (CLR) upon program launch.
Method Signature
Methods are declared in a class, struct, or interface by specifying the access level such as public or private, optional modifiers such as abstract or sealed, the return value, the name of the method, and any method parameters.
Custom Method
is a user-defined method that contains a specific set of code instructions.
Method Overloading
in C# allows you to define multiple methods with the same name but different parameter lists within the same class
This allows the performance of similar operations with different types or numbers of parameters.
Array
Is declared by specifying the type of its element
type [ ] array name;
Single-dimensional array
is a sequence of like elements.
You access an element via its index.
The index is its ordinal position in the sequence.
Two dimensional array
arrays that have more than one dimension
initialized like “type [ , ] array name”
Jagged Array
Is an array whose elements are arrays, possibly of different sizes
is sometimes called an "array of arrays."
Its elements are reference types and are initialized to null
ArrayList
stores elements of multiple data types whose size can be changed dynamically.
Linked List
is a linear data structure where each element (node) in the list is a separate object containing a data element and a reference (link) to the next node in the sequence
Modifiers
control the access levels and visibility of class members (fields, properties, methods, etc.) within a C# program.
public
The code is accessible for all classes
Private
The code is only accessible within the same class
Protected
The code is accessible within the same class, or in a class that is inherited from that class
Internal
The code is only accessible within its own assembly, but not from another assembly
Encapsulation
Means protecting the internal data of a class and controlling how other parts of the program can access or change it
It is commonly implemented using Private fields, Public properties, Public methods that control behavior
Abstraction
Means showing only the important features of an object while hiding unnecessary details
Implemented using abstract classes and Interfaces
Interface
Defines a set of actions that a class must implement
Inheritance
Allows one class to reuse the fields and methods of another class.
Polymorphism
Allows different classes to respond to the same method call in different ways
Class
Defines the structure of the code
This
Is a keyword that refers to the current object
It is commonly used when a field and a parameter have the same name
Method Overriding
This means that a child class changes the behavior of a parent method
Static Class
is used without creating an object
it cannot be instantiated and only contains static members
Sealed Class
a class that cannot be inherited