Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. PROS:
  2.  
  3. One advantage of anonymous inner classes is that no one can ever use it anywhere else, whereas a named inner class can be used anywhere you want.
  4. The key benefit of an anonymous class is encapsulation.
  5. Inner classes also implements encapsulation.
  6. Keeping the small class within top-level classes places the code closer to where it is used and makes the code more readable and maintainable.
  7. While lambda expression increases conciseness.
  8. CONS:
  9.  
  10. Lambda expression decreases readability and are difficult to understand.
  11. Inner classes get limited support of ide/tools as compared to the top level classes.
  12. While using anonymous inner class you cannot define a constructor.
  13. Ans 2:
  14.  
  15. Because lambda expressions are nothing more than a language feature that the compiler translates into the exact same code that you are used to working with.
  16. And also there are no performance implications since the compiler will translate your lambda expression into equivalent code.
  17. Ans 3:
  18.  
  19. Event-Driven Systems pass and persist events, these events are immutable and can be replayed to allow the systems to take snapshots of its behavior.
  20. A lot of transaction issues are alleviated once idempotency and retrial logic is added to a system. The system can retry messages an infinite number of times to the recipient until there is a message acceptance and acknowledgment from the receiver.
  21. These abstractions enable the programmer to focus on the business logic of a system and add subscribers to events with minimum coupling with other services. Decoupling the system is one of the advantages of event-driven systems.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement