Week 1 Flashcards
What is Rapid Application Development (Tool use)?
Heavy Focus on tool use to reduce development time and costs
Deadline often prioritised over requirements
What is Agile Develpment?
Software development practice based on short iterative “sprints”
Sprints: Short, consistent cycles (2-4 weeks) where specific features are developed and reviewed.
What is a Pair Programming?
Two people working on a single programming task
2 Roles:
Driver - Typing the code
Navigator - Responsible for overall direction of programming
Roles periodically switched between the 2
What is the benefits of Pair Programming?
Better productivity
Good for transferring skills to each other
What are the benefits of OOP Programming?
Encapsulation/ information hiding
Inheritance
Polymorphism
What are the negatives of Encapsulation?
If you have 2 tightly coupled classes
rely heavily on members in each class
Lots of work involed in creating functions to access those members due to encapsulation
This issue is overcome with nested classes
What are Nested Classses?
Where a class is defined in another class allowing the Outer class
Helps you logically group classes that are used in one place
What are the 2 types of Nested Classes?
Static Nested Class:
Definition: A class defined within another class with the static keyword.
Access: Can only access the static members of the outer class, not the instance variables or methods.
Purpose: Useful for grouping helper classes that don’t need to access the instance data of the outer class.
Inner Class:
Definition: A class defined inside another class without the static keyword.
Access: Can access both static and instance members of the outer class, as it is associated with an instance of the outer class.
Purpose: Ideal for handling tasks that are inherently linked to the instance of the outer class, like handling UI actions or iterating over data specific to the outer class.
What is the difference between a Class and a Nested Class (modifiers)?
Standard outer class can only be declared with two modifiers, public and the default package private
A nested class can be declared as any of the standard modifiers (public, private, protected or package private)
What are the properties of Inner Classes?
Can be difficult to spot in code
Will produce two class files on compilation:
Outerclass.class
Outerclass$InnerClass.class - tells you the inner class relies on the outer class
All nested classes can be accessed externally
What is an example of a Static Nested Class?
Class Car {
…
static class Gearbox {
…
}
}
Accessed using enclosing class name:
Car.Gearbox
Creates object for static nested class:
Car.Gearbox nestedobject = New Car.Gearbox();
What is a Local Class?
Defined and exist solely within a block (usually a method)
Cannot access method local variables (unless passed as arguments) unless they are declared as final
Can access all the members of the outer class instance like standard inner class members
What are Anonymous classes?
Classes that are declared without any class name at all - therefore they are named anonymous classes
Not only may these be defined within a method, they may also be defined within an argument to a method!