Options API vs Composition API in Vue.js

🧩 1. What Are They? Vue offers two ways to write components: API StyleIntroduced InDescriptionOptions APIVue 2Organize code by options (data, methods, computed, etc.)Composition APIVue 3Organize code by logic using functions inside a setup() block Both can coexist in the same app — they just use different syntax and patterns. ⚙️ 2. Options API…

0 Comments

Provide and Inject

🧩 What are provide and inject? provide and inject are Vue features that let you share data or functions between a parent component and its descendant components — without having to pass props through every intermediate level. Think of it like a “context system”, similar to React’s Context API. ⚙️ Basic Example 🟢 Parent…

0 Comments

Component in Vue.js

🧩 What is a Component? A component in Vue is a reusable instance of a Vue app, with its own: template (HTML structure) script (data, methods, props) styles (optional CSS) They help you organize, reuse, and maintain code easily. ⚙️ Basic Structure of a Component A Vue component file (usually .vue) has three main…

0 Comments

Spring Validation – Validator

In Spring, the Validator interface is used for custom validation logic on objects, typically before saving them to a database or processing user input. 🧩 Purpose Validate fields of a Java object (e.g., form input). Can implement complex rules not possible with simple annotations (@NotNull, @Size). Works with Spring MVC’s @Valid or programmatically. Key…

0 Comments

Spring Web Request Lifecycle

Spring Web Request Lifecycle — describes the sequence of steps an HTTP request goes through in a Spring (Boot) application from arrival to response. 🧩 Lifecycle Steps Client sends HTTP requestBrowser, mobile app, or client sends request to the server. Servlet Container (Tomcat/Jetty)The request hits the Servlet container, which delegates it to DispatcherServlet. DispatcherServlet…

0 Comments

Spring Caching

Spring Caching — a framework feature that allows you to store method results in cache to improve performance and reduce database or computation load. 🧩 Purpose When a cached method is called with the same parameters again, Spring returns the cached result instead of executing the method. Basic Example: @Service public class UserService {…

0 Comments

@JsonIgnore

@JsonIgnore — a Jackson annotation used to exclude a field or method from JSON serialization or deserialization. 🧩 Purpose Prevents sensitive or unnecessary data from appearing in JSON responses or being read from incoming JSON. Example: public class User { private String username; @JsonIgnore private String password; // getters & setters } public class…

0 Comments

@SpringBootTest

@SpringBootTest — used to load the entire Spring application context for integration testing in Spring Boot. 🧩 Purpose It allows you to test your app as it would run in production — with all beans, configurations, and environment loaded. Example: @SpringBootTest class UserServiceTest { @Autowired private UserService userService; @Test void testCreateUser() { User user…

0 Comments

@PreFilter & @PostFilter

@PreFilter & @PostFilter are Spring Security annotations used to filter collections or arrays before or after a method executes — based on security expressions. 🧩 @PreFilter Filters input collection before the method runs. Example: @PreFilter("filterObject.owner == authentication.name") public void deleteFiles(List<File> files) { // only files owned by current user remain in 'files' files.forEach(fileRepo::delete); }…

0 Comments

Spring Security Context

Spring Security ContextThe SecurityContext in Spring Security holds the authentication and security-related details (like the logged-in user, roles, etc.) for the current thread of execution. It’s stored in a ThreadLocal, so each request has its own context. Example: import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; @RestController public class UserController { @GetMapping("/me") public String getCurrentUser() { Authentication auth…

0 Comments

End of content

No more pages to load