Week 3 Flashcards
What is a Lambda Expression?
A block of code that you can pass around between objects
Syntax is (arguments) -> (body)
Examples:
(int x, int y) -> {return x * y};
s -> {System.out.println(s) }
() -> System.out.println(“Hello from a Lambda expression”)
What is Thread Confinement?
Thread confinement is a concurrency technique where an object is accessed exclusively by a single thread, ensuring that it is never accessed simultaneously by multiple threads.
This simplifies development because no synchronization is needed for the object as long as it remains confined to the same thread.
Why are version control tools so important?
Revision Card: Importance of Version Control Tools
1. Tracking Changes:
Allows you to see what changes were made, who made them, and when.
Helps understand the history of changes and easily identify when a problem was introduced.
2. Collaborating:
Multiple people can work on the same project or document without overwriting each other’s work.
Enhances team collaboration and efficiency, making it easier to integrate work from different team members.
3. Backup and Restore:
Keeps a backup of every version of a file or project.
You can revert to previous versions if something goes wrong, ensuring work is never lost.
4. Branching and Merging:
Allows creation of separate ‘branches’ for experimenting or working on new features without affecting the main project.
Provides a safe environment for testing new ideas and seamlessly integrating them back into the main project.
What are some examples of Version Control tools
Version Control Systems:
- Git
- Mercurial
- Concurrent Versions System (CVS)
Web Based Repositories:
- Github
- Google Code
Why are Version Control Tools important?
Gives the development team a project-wide ‘undo button’
Allows multiple developers to work on same code base in a controlled manner - code that no longer lost through overwrites
Keeps record of changes
What is a Repository?
Place to store all your project files/ documents/ directories
Acts as a server usually based on a safe,secure and reliable machine
What Should we store in the Version Control System (hint: S,BS,PD)?
Source
Build Scripts
Project Documents
Everything you need if your local machines died!
What is a Centralized Repository?
centralized repository is a single location where all data or files are stored
Think of it like a library where all the books are kept in one place. When someone wants to access a book (or data), they go to that library. If the library is closed or the book is checked out, it can’t be accessed. In this model, there’s usually one main authority or organization that controls and manages the repository
What is a Decentralized Repository
A decentralized repository spreads data across multiple locations or nodes.
Instead of relying on a single point of control, each participant has a copy of the data. This is like a group of friends who each have their own copies of a book—if one person loses theirs, others still have access. This model is often more resilient because even if one node goes down, the data remains accessible from others.
What are branches in Repositories?
Branching in repositories is a way to create separate lines of development within a project
It allows multiple versions of a project to be worked on simultaneously without affecting the main or stable version
What is Forking?
Somewhat different from the term branching
Means independant branch of development
Forking means making a copy of someone else’s project so you can work on it yourself
What is Strict Locking?
Only one person can change a file at any one time
What is Optimistic Locking?
All files can be changed, but if changed in the repository since last check out then local copy needs to be updated before you can commit the change