In the AOP workflow, the process involves two key phases: **Development:** - Identify cross-cutting concerns. - Create aspects. - Define pointcuts to specify where logic should be applied. - Implement advice, which constitutes the logic itself. **Runtime:** During runtime, the AOP framework performs the following steps: - Detect aspects. - Create target objects and AOP proxies. - When a client invokes a method, the proxy intercepts the call. - If a pointcut matches, the advice (Before, AfterReturning, AfterThrowing, After) executes around the target method. - The Around advice has the ability to control the execution of the target method. - Finally, the results are returned to the client through the proxy. #SpringBoot #Java #Coding #Developers #SoftwareEngineering #TechLearning
How AOP Works in Spring Boot: Development and Runtime
More Relevant Posts
-
🚀 Day 412 of #500DaysOfCode 🧩 Problem: 3542. Minimum Operations to Convert All Elements to Zero Platform: LeetCode (Medium) 📘 Problem Statement: Given an array of non-negative integers, you can perform operations where you select a subarray and set all occurrences of the minimum number in that subarray to 0. Your goal is to find the minimum number of operations required to convert all elements in the array to 0. 💡 Example: Input: nums = [3,1,2,1] Output: 3 Explanation: 1️⃣ Select [1,3] → set 1s to 0 → [3,0,2,0] 2️⃣ Select [2,2] → set 2 to 0 → [3,0,0,0] 3️⃣ Select [0,0] → set 3 to 0 → [0,0,0,0] ⚙️ Intuition: Each continuous non-zero segment in the array represents one operation. Zeros act as boundaries that divide these segments. Hence, the minimum number of operations equals the count of continuous non-zero segments. 🧠 Approach: Iterate through the array. Count the number of times a new non-zero segment starts → (when nums[i] != 0 and (i == 0 || nums[i-1] == 0)). 🕒 Complexity: Time: O(n) Space: O(1) 🔥 Learned how identifying segment patterns in arrays can lead to simple and efficient solutions! #Day412 #LeetCode #Java #CodingChallenge #ProblemSolving #DSA #Programming #100DaysOfCode #500DaysOfCode #CodeNewbie #Developers
To view or add a comment, sign in
-
-
⚡ Why async/await in C# is NOT Just Syntactic Sugar? Many developers think async/await is just a prettier way to run code on another thread. ❌ It’s not. It’s a compiler transformation that changes how your method executes under the hood. Here’s what really happens 👇 🧠 1️⃣ The Common Misunderstanding Most developers assume async/await is simply a wrapper around multithreading — but it’s much smarter than that. ⚙️ 2️⃣ What Actually Happens When you mark a method as async, the C# compiler rewrites it into a state machine. That means it automatically handles what happens before, during, and after an asynchronous operation — including exceptions, returns, and continuations. Your code looks synchronous, but it’s actually running asynchronously, pausing and resuming seamlessly. 🔁 3️⃣ How It Works at Runtime When an awaited operation starts, the method is suspended — no thread is blocked. The system registers a continuation, and once the operation completes, the method resumes exactly where it left off. This allows other code to execute in the meantime, keeping your app responsive and efficient. 🧩 4️⃣ Why It’s Not Just Syntax Sugar Without async/await, you’d have to manually chain callbacks and continuations — messy, error-prone, and hard to read. The compiler now does that for you automatically, turning complex asynchronous logic into clean, readable code. 💡 5️⃣ The Right Mental Model Think of await as saying: “Pause this method, let the system handle other work, and continue when the task is ready.” It’s about non-blocking execution, not just parallel processing. 🚀 Key Takeaway ✅ async/await isn’t just syntactic sugar — it’s a powerful compiler feature that enables clean, non-blocking, asynchronous code. ✅ It gives you the clarity of synchronous code with the performance of asynchronous execution. #dotnet #csharp #asyncawait #developers #softwareengineering #programmingtips #development #ASP #Backend
To view or add a comment, sign in
-
-
Problem: Final Value of Variable After Performing Operations Difficulty: Easy Sometimes coding challenges are not about complex algorithms — they’re about writing clean, readable logic. Today’s problem gives a list of increment/decrement operations (++X, X++, --X, X--) and asks to compute the final value of a variable starting from 0. Simple? Yes. But it's a good reminder that clarity > cleverness. #Day17 #LeetCode #Java #BeginnerFriendly #Consistency #100DaysOfCode #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
🚀 Custom Annotation + AOP in Spring Boot (Clean & Powerful Combo) Ever wanted to run common logic (like logging, validation, or performance tracking) without cluttering your main code? That’s where Custom Annotations with AOP (Aspect-Oriented Programming) shine. ✅ How it works: • Create a custom annotation → e.g. @LogExecutionTime • Create an Aspect class using @Aspect → intercept methods annotated with it • Use Around Advice → execute logic before & after the actual method 🧠 Result: Every method marked with @LogExecutionTime automatically logs how long it took — clean, reusable, and zero duplicate code. #SpringBoot #Java #AOP #CleanCode #AnnotationMagic
To view or add a comment, sign in
-
-
💡 𝗝𝗮𝘃𝗮/𝐒𝐩𝐫𝐢𝐧𝐠 𝐁𝐨𝐨𝐭 𝐏𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞 𝗧𝗶𝗽 🔥 💎 𝐉𝐚𝐯𝐚 𝟐𝟏 𝐕𝐢𝐫𝐭𝐮𝐚𝐥 𝐓𝐡𝐫𝐞𝐚𝐝𝐬 Managing thousands of concurrent operations? Platform threads choking your system? Here's the solution: 𝐕𝐢𝐫𝐭𝐮𝐚𝐥 𝐓𝐡𝐫𝐞𝐚𝐝𝐬! ✔This revolutionary feature from Project Loom provides super lightweight threads managed directly by the JVM. While classic threads consume MBs of memory, virtual threads stay at just KB level. 💡 𝐖𝐡𝐲 𝐚𝐫𝐞 𝐭𝐡𝐞𝐲 𝐠𝐚𝐦𝐞-𝐜𝐡𝐚𝐧𝐠𝐢𝐧𝐠? • Perfect for I/O-intensive operations. • Enable simple thread-per-request model at scale. • No need for complex reactive programming. • Backward compatible with existing code. ✨The magic happens when your application handles thousands of concurrent requests. ⚡Traditional threads would exhaust system resources, but virtual threads handle this elegantly. 🔥 They automatically yield when blocked, allowing other virtual threads to execute on the same platform thread. ✅ So, A REST API that previously handled 1000 concurrent connections can now handle 100,000+ with the same hardware, just by switching to virtual threads. 👍 𝐂𝐫𝐞𝐚𝐭𝐢𝐧𝐠 𝐭𝐡𝐞𝐦 𝐢𝐬 𝐬𝐢𝐦𝐩𝐥𝐞: Use Thread.ofVirtual() or Executors.newVirtualThreadPerTaskExecutor(). Your blocking code becomes scalable without rewriting! #java #springboot #programming #softwareengineering #softwaredevelopment
To view or add a comment, sign in
-
-
🚀 CLEAN CODE REMINDER: COMMENTS THAT COUNT “Comment the why, not the obvious what—getters, setters, constructors don’t need notes.” When code is self-explanatory, extra comments add noise. Save comments for intent, trade-offs, and surprising decisions: ✅ Explain why a rule exists, a constraint, or a workaround. ✅ Capture domain knowledge, edge cases, and assumptions. ❌ Don’t narrate trivial code (e.g., getters/setters/constructors). Keep it crisp. Let code show the what. Use comments to preserve the why. ✍️ #CleanCode #Java #SpringBoot #Readability #CodeQuality #SoftwareEngineering #DevBestPractices #Refactoring #Comments #Maintainability
To view or add a comment, sign in
-
-
✋ Nested ifs are not logic. Every time you open another bracket, you dig one layer deeper into the ruins of readability. Clean code is not about being smart. "It’s about leaving the next developer with fewer nightmares." Simpler doesn’t mean dumber — it means readable. 😶🌫️ If your code looks like a Russian nesting doll, it’s time for refactor. #CleanCode #dotnet #Java #backend #TheBackendFundamentals #architecture #DI #carbon.now.sh
To view or add a comment, sign in
-
-
🚀 Day 7️⃣0️⃣ of #100DaysOfCode Solved LeetCode Problem #2169 — Count Operations to Obtain Zero ⚙️💡 Logic: In this problem, we repeatedly subtract the smaller number from the larger one until one of them becomes zero. If num1 >= num2, subtract num2 from num1. Else, subtract num1 from num2. Increment the operation count each time. Continue until either num1 or num2 becomes 0. 💭 Simple yet logical — one of those problems that tests clarity of thought over complexity. #LeetCode #Java #100DaysOfCode #ProblemSolving #CodingJourney #LearnByDoing #DeveloperLife #LogicBuilding #TechCommunity #CodeDaily #KeepCoding
To view or add a comment, sign in
-
-
In software, “boring” isn’t a flaw — it’s a feature. The most resilient systems aren’t the flashy ones. They’re the ones grounded in standards, built on predictability, and free from arrogant tech stacks that forget their users. I wrote about why “Boring Is Beautiful” — and how frameworks like Quarkus and open standards help teams avoid hidden technical debt. → Read the full piece: https://lnkd.in/gp7KtKU3 #Java #Quarkus #SoftwareArchitecture #EngineeringLeadership #TechnicalDebt
To view or add a comment, sign in
More from this author
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development