Level 57 Level 59
Level 58

Object Oriented Programming Concepts, Using C#

26 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

What is an Object
It can be considered a "thing" that can perform a set of related activities.
What is a Class
a blueprint/plan/template for an object
Name 5 principles to follow in designing a class
What is the "Single Responsibility Principle" (SRP)
A class should have one, and only one, reason (or responsibility) to exist. That responsibility should be entirely encapsulated by the class.
What is the Open Closed Principle (OCP)
You should be able to extend a class behavior without modifying it.
What is the Liskov Substitution Principle (LSP)
If a statement is true for a base class, then you should be able to use (in the statement) an instance of a derived class. The statement should still be valid.
What is the Interface Segregation Principle (ISP)
Make fine grained interfaces that are client specific.
What is the Dependency Inversion Principle (DIP)
Depend on generalities (abstractions), not on concrete implementations.
A PIE (mnemonics)
What concepts group OOP system-design techniques
What is Encapsulation
The inclusion, within an object, of all the resources (attributes, data & methods) it needs to function
What is "Association"
Most general relationship between classes, as: companies "use" security guards (but don't HAVE to).
What is "Aggregation"
A directional type of "Association" between classes that indicates inclusion and is usually stated using forms of the verb "to have", as in: companies have (sometimes) security-guards.
What is "Composition"
An "Aggregation" of one class within another which indicates that the lifetime of the two classes is linked: like University and Faculties. It's usually stated by the phrase "composed of", as "a University is comp…
What is abstraction
A means to reduce complexity by hiding irrelevant details of an object & emphasizing its reason for existence, its qualities and its properties. It emphasizes the "what", rather than the "how".
What is generalization
A means to reduce complexity by replacing multiple entities that perform similar functions with a single one.
What method modifier (public, private, ... etc) are allowed on interface methods.
Only the "new" modifier is allowed, indicating that it hides a method of the same name on an inherited interface.
If a class, interface or struct is not marked with an access modifier, what access level does it get by default: public, private, protected, internal
What modifiers are valid in C# interface methods (public, private, protected, internal, new, static
new is the ONLY valid modifier in an interface method. The method is, by default, also "public" & "abstract", but it should not be marked as such.
protected interface MyInterface{ ... }
No, the ONLY access modifiers valid on a (global) class/interface are "public" and "internal"
Can a C# class, or interface, be nested within another interface
No, classes and interfaces can NOT be nested within another interface.
If an object, Obj, is defined as an instance of a derived class, then:
If a method is declared "virtual" in a base class, what is the difference between "overriding" it, or marking it "new", in a derived class.
What is (object) polymorphism
Means: "many-shaped", and means an object can behave as an instance of multiple classes.
What is method overloading
Is a form of method polymorphism: the ability to define several methods all with the same name.
What is operator overloading
A type of method polymorphism that causes operators (+, -, ==, *) to behave differently depending on the type of its arguments.
What is method overriding
A "virtual" method, if "overridden" in a subclass, causes the new method to be invoked on the object EVEN when the derived object is declared/used as if it were an instance of its base class.
What is a "use case"
It is the description of what an "actor" (not necessarily a person) perceives when using a function of a software system.