-
Notifications
You must be signed in to change notification settings - Fork 0
BackEnd
- Spring Boot: 3.4.4
- Maven
- Java 21 JDK
- MySQL Driver
- Spring Web
- Spring DATA JPA
A Spring Bean is a Java object that is created and managed by the Spring Container. It is eligible for dependency injection.
- Normally, the programmer takes care of object creation.
- In Spring, the framework creates the object, injects its dependencies, and controls its lifecycle.
An instance of a class managed by the Spring container.
MyService myService = new MyService();
@Component
public class MyService {
// some logic
}With Spring:
Inject its to the another class
@Autowired
private MyService myService;- Spring Container: Holds all beans, resolves dependencies between them, and controls their lifecycle.
@Component: Marks a class as bean @Autowired : Tells Spring to inject the required bean
-
IoC(Inversion of Control):You give up control of creating and managing objects to a framework or container (like Spring), instead of doing it manually in your own code.
-
Dependency Inversion: design principle that Code should depend on abstractions, not concrete implementations
-
Dependency Injection: is a technique where an object gets its dependencies from outside, rather than creating them itself.
Example :
public class Car {
private Engine engine = new Engine(); // tightly coupled
}
public class Car {
private Engine engine;
public Car(Engine engine) { // dependency is injected from outside
this.engine = engine;
}
}- Constructor injection
- Field injection (@Autowired)
- Setter injection
Mockito is a Java library that helps you mock dependencies. In unit testing, we do not use real dependencies like databases or services. Instead, we simulate their behavior using mocks.
Mocks are like fake collaborators that behave exactly how program tells them.
It does:
- Create mock objects of classes and interfaces.
- Stub methods to return specific values.
- Verify method interactions (e.g., whether a method was called, how many times, etc.).
- Avoid depending on actual implementations (e.g., real databases, services, etc.).
Examples:
@Mock
private UserRepository userRepository;
(This tells Mockito to create a fake version of UserRepository.)
@InjectMocks
private AuthService authService;
(Tells Mockito to inject the mocked dependencies (userRepository, passwordEncoder, etc.) into the authService.)
@BeforeEach
void setup() {
MockitoAnnotations.openMocks(this);
}
(Initializes all the mocks before each test case.)- when(...).thenReturn(...): tell the mock what to return when a method is called.
- assertEquals(...): check if the output is what you expect.
- Only the mocked versions of the database and services are used.
Lombok reduce boilerplate code through compile-time code generation.
Boilerplate code:are sections of code that are repeated in multiple places with little to no variation.
- @Data Getters, setters, toString(), equals(), hashCode()
- @Getter Getters for all fields
- @Setter Setters for all non-final fields
- @ToString toString() method
- @EqualsAndHashCode equals() and hashCode() methods
- @NoArgsConstructor No-args constructor
- @AllArgsConstructor Constructor with all fields
It reduces the code clutter, improves readability
- OrphanRemoval: is an important cascade operation in JPA (Java Persistence API) that controls what happens to child entities when they're removed from a parent relationship
- orphanRemoval is a JPA annotation attribute that:
- When set to true, automatically deletes child entities when they're removed from their parent's collection
- Only applies to @OneToMany and @OneToOne relationships
Use orphanRemoval=true when:
- Child entities have no meaning without their parent (composition)
- You want to automatically clean up "orphaned" children
- You're modeling a true parent-child relationship where children shouldn't exist independently
We will use Google Cloud Service to deploy our database. You can connect to it from your local environment.
Important Rules:
⚠️ DO NOT CHANGE ANYTHING IN THE TABLES without permission- Everyone can use it for:
- SELECT queries
- Running applications locally
- Examining the database structure
- Create a new connection by clicking the "+" button next to "MySQL Connections"
- Configure with these details:
- Connection Name: wasteless
- Hostname: [server IP provided to you]
- Username: [username provided to you]
- Password: [password provided to you] (store in vault)
- Click "Test Connection" to verify
- Once successful, save and close the configuration
- Open the connection to run queries
Update your application.properties file:
spring.datasource.url=jdbc:mysql://<service_ip>/<database_name>?useSSL=false&serverTimezone=UTC
spring.datasource.username=<givenusername>
spring.datasource.password=<givenpassword>
WasteLess App
- Customer Milestone 1 Report of CMPE 451 Fall 2025
- Customer Milestone 2 Report of CMPE 451 Fall 2025
- Customer Milestone 3 Report of CMPE 451 Fall 2025
- Meeting 1 (Lab-1) - (23.09.2025)
- Meeting 2 (Zoom) - (25.09.2025)
- Meeting 3 (Lab-2) - (30.09.2025)
- Meeting 4 (Zoom) - (02.10.2025)
- Customer Meeting 1 - (06.10.2025)
- Meeting 5 (Lab-3) - (07.10.2025)
- Meeting 6 (Zoom) - (09.10.2025)
- Meeting 7 (Lab-4) - (14.10.2025)
- Meeting 8 (Zoom) - (16.10.2025)
- Meeting 9 (Zoom) - (22.10.2025)
- Meeting 10 (Zoom) - (30.10.2025)
- Meeting 11 (Lab-5) - (05.11.2025)
- Meeting 12 (Zoom) - (6.11.2025)
- Meeting 13 (Lab-6) - (11.11.2025)
- Meeting 14 (Zoom) - (13.11.2025)
- Meeting 15 (Lab-7) - (18.11.2025)
- Meeting 16 (Zoom) - (20.11.2025)
- Meeting 17 (Zoom) - (26.11.2025)
- Meeting 19 (Zoom) - (11.12.2025)
- Meeting 20 (Zoom) - (17.12.2025)
🛠️ Backend Meeting Notes
💻 Frontend Meeting Notes
📱 Mobile Meeting Notes
- Lab 1 Report
- Lab 2 Report
- Lab 3 Report
- Lab 4 Report
- Lab 5 Report
- Lab 5 MVP Report
- Lab 6 Report
- Lab 7 Report
- Lab 7 M2 Demo Preparation Report
- Lab 8 Report
- Lab 8 Requirements Review & Acceptance Planning
- Lab 9 Report
- Lab 9 M3 Demo Preparation Report
- Requirements
- Elicitation Questions
- Use Case Diagrams
- Class UML Diagram
- Sequence Diagrams
- Demo Scenario - MS1
- Demo Sceanrio - MVP
- Demo Sceanrio - MS3
Abdurrahman Arslan
Abdülkerim Kasar
Ali Bartu Konca
Arda Yalçındağ
Cengiz Bilal Sarı
Emre Kılıç
Osman Yusuf Tosun
Serdar Bahar
Yusuf Onur Öksüz
Yüksel Eren Şen
⌛ 352 Sidebar
🏠 Home
📌 Team Members and Contributions
- Meeting 1 - (14.02.2025)
- Meeting 2 - (20.02.2025)
- Meeting 3 - (27.02.2025)
- Customer Meeting 1 - (03.03.2025)
- Meeting 5 - (06.03.2025)
- Meeting 6 - (11.03.2025)
- Meeting 7 - (13.03.2025)
- Meeting 8 - (16.03.2025)
- Meeting 9 - (20.03.2025)
- Meeting 10 - (24.03.2025)
- Meeting 11 - (10.04.2025)
- Meeting 12 - (16.04.2025)
- Meeting 13 - (22.04.2025)
- Meeting 14 - (28.04.2025)
- Meeting 15 - (03.05.2025)
- Meeting 16 - (05.05.2025)
- Meeting 17 - (09.05.2025)
- Meeting 18 - (11.05.2025)