1/55
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Object
An object is an instance of a class that is made up of data/attributes and behaviours/methods.
Private
It restricts access to certain class members,
only accessible within the class in which it is defined
Public
The entire class is public and accessable to other classes. This includes methods, variables, etc.
Static
Whatever is defined as static means that it belongs to the class.
Protected
Allows class members within same class and by subclasses even if in different packages
Extends
transfers use of parent class operations and methods to subclass
Class
A class is a blueprint that defiens the attributes and methods that objects will have
Instantiation
process of creating object from class
UML Diagram
visual representation of the design of a system before coding (relationship between attributes, methods and classes)
Relationships
3 types: is-a: one type is subtype of another, has-a: one type includes instance of another, uses: one portion of the program relies on another;
connections between classes in UML diagram
Constructing Objects
creating instances of classes, initializing attributes.
Data Types
2 types: Reference (String, Double, Integer, Boolean) and Primitive (int, double, char, boolean);
Parameter
value passed into a constructor
Encapsulation
Encapsulation means hiding an object's details and controlling access using methods. This protects data and keeps it secure. Hiding of instance variables
Inheritance
Inheritance is a feature that represents the “Is-A” relationship between different classes. Inheritance allows a class to have the same behavior as another class and extend or tailor that behaviour to provide specific action for specific need.
Polymorphism
Polymorphism is when different objects respond in different ways to the same method call, typically through inheritance
Advantage of Encapsulation
Increased reusability
Flexibility of design
Controlled Access
Reduced Errors
Improved security
Easier for team projects
Advantage of Inheritance
Code Reusability
Easier Maintenance
Reduced Errors
Extensibility
Easier for team projects
Advantage of Polymorphism
Code Flexibility
Easier program extenstion
Improved maintainability
Easier for team projects
Advantage of Libraries
Faster development
Libraries provide ready-made solutions for common tasks, eliminating the need to code from scratch, significantly speeding up the development of code.
Increased reliability:
Library code is thoroughly tested and debugged by its creators and the wider community. This means that using library objects can lead to more reliable software, as the risk of introducing bugs is reduced compared to custom written code.
Easier debugging and Testing
Since libraries are well-structured and have defined interfaces, isolating and fixing eros becomes much easier.
Standardisation and Consistency
Libraries promote the use of standardized and consistent code patterns. This improves code readability and maintainability, making it easier for different developers to collaborate on a project.
Reduced development costs
By reusing existing code, libraries help reduce development costs with writing, debugging and testing new code.
Access to specialized expertise
Libraries often encapsulate the expertise of experienced developers in specific domains. By using a library, you can leverage this expertise without needing to be an expert in that particular area yourself.
Advantage of OOP
Improved software development
Faster development
Higher quality software
Enables security
Enables modularity
Disadvantage of OOP
Steeper learning curve
Increased Complexity
Larger program size
slover performance
Not suitable for all programs
Programming Teams
A programming team is a group of developers who collaborate to build and maintain software by dividing tasks among members
Advantage of Modularity
Improved maintainability
Changes or fixes can be isolated to specific modules minimizing the impact on the rest of the program. This makes debugging easier and reduces the risk of introducing new errors when making updates.
Enhanced readability and Understandibility
Modular code is easier to read and understand because each module focuses on a specific task. This makes it easier for developers to grasp the overall structure of the program and collaborate effectively.
Increased reusability
Modules can be reused in different parts of the same program or even in other projects. This promotes code efficiency and saves time and resources.
Simplified Testing
Modules can be tested independently, allowing for more thorough and efficient testing. This helps identify and address errors early in the development process.
Parallel Development
Modularity enables different developers or teams to work on separate modules concurrently, accelerating the development process.
Flexibility and Scalability
Modular programs are more adaptable to changing requirements. New modules can be added or existing ones modified without requiring major changes to the entire system.
Modularity
Modulairty involves break dowing large complex problems into smaller modules. Each module has a specific function
Identifier
An identifier is a name given to a variable class, method or object in a program so it can be referenced using code
Primitive Data type
A primitive data type is a data type which does not need to be imported and is predefined in the programming language, it stores a simple single value
Instance
Is a specific object created from a clase using instansiation
Variable
A variable is a named location in memory used to store a value that can change during program execution.
Parimeter Variable
A parameter variable is a variable defined in a method that receives a value when the method is called.
Local Variable
A local variable is a variable declared inside of a method that can only be used within that method
Method
A method is a function defined in a class that performs a specific operation.
Accessor
an accessor method/getter method is a method used to return the value of instance variables of an object
Mutator
A mutator method/setter method is a type of method which is used to modify the instance variable of an object
Constructor
A constructor is a special type of method used to create and initialize an object
Method Signature
A method signature defines the methods name and its parameters. It uniquely identifies a method.
Overriding
Overriding is when a subclass provides its own implementation of a method that already exists in its superclass
Overloading
Method overloading is when multiple methods in the same class can have the same name but different parameter lists.
Potential Ethical Issues
The effects that computer systems or software have on people and society, such as accessibility, employment, usability, and how technology changes communication or daily life.
Potential Social Issues
The moral responsibilities involved in developing and using software, including protecting privacy, ensuring security, properly testing software, and respecting intellectual property.
Static Array
A static array is an array with a fixed size that is determined when the arry is created and cannot be changed during execution
Dynamic Array
A dynamic array is an array whose size can change during program execution, allowing elements to be added or removed as needed.
Advantages and Disadvantages of a dynamic array
Flexible size
Efficient memory use
Convenience for unknown data sizes
Disadvantages:
Slower performance due to resizing
More complex
May require extra memory
Advantages and disadvantages of static arrays
Fast access
Simple to implement
Predictable memory so no overflow
Disadvantages:
Fixes Size
Possible memory waste
Risk of overflow
Disadvantages of Polymorphism
Complex code
Harder to debug as different objects may executre different versions of a method
reduced readability which hinders parrallel development
Disadvantages of Encapsulation
More methods required
Reduced flexibility
Increased development time
More complex parallel development
Disadvantages of Inheritance
Increased dependencies
Reduced flexibility
Harder to update code
Increased complexity
Abstraction
Abstraction is the process of hiding complex details of the code and showing only the essential features of an object or system
Abstraction advantages
Reduces complexity by hiding unnecessary details
Makes programs easier to use and understand
Improves maintainability because implementation can change without affecting users
Improved parallel development
Abstraction disadvantages
Can reduce flexibility
Extends development time
May be difficult/inefficient to implement
Decomposition
Decomposition refers to the process of breaking down a complex problem or system into smaller, more manageable parts called objects
Decomposition advantages
Reduces complexity
Improved modularity
Easier testing
Enhanced abstraction
Code reusability
Decomposition Disadvantages
Dependencies
requires careful planning
Aggregation, Association, and Composition
Aggregation is a “has-a” relationship between classes where one object contains another object, but the contained object can exist independently.
Association is a relationship where two classes are connected or interact with each other, but neither owns the other.
Composition is a strong “has-a” relationship where one object contains another object and the contained object cannot exist independently of the container.
Dependencies
another term for ‘‘uses’ relationship in UML
Disadvantages of dependencies
changes in one component may affect others
increases system complexity
makes debugging more difficult
reduces flexibility and maintainability
Makes parallel developlment more difficult