Skip to main content

Tech Conversant Weekly Jan 30 - Feb 04

Topic: General                                                                                                                Level: All

In this post, we shall catch up on the multi-faceted technological updates that happened over the past week as well as a few that seized my attention,

Java has some extraordinary libraries which blow your mind such as,
1. Using DelayQueue instead of BlockingQueue, offering to the queue after the delay lapse 
2. DateTimeFormatter returning strings like 'in the morning' and 'in the afternoon 
3. StampedLock instead of ReadWriteLock and optimistic ReentrantReadWriteLock 
4. Concurrent Accumulators instead of AtomicXXX references for concurrent updates without locks 
5. Hex format 
6. BinarySearch in Arrays of sorted ordering returning found value else the nearest occurrence for insertion 
7. BitSet instead of a boolean array to operate the bits for and, or, xor operations 
8. Phaser instead of CountDownLatch to await on the threads to reach the barrier

Considerably worthwhile third-party libraries, that ease development, and verification
1. Instancio for model-based test data generation such that all the edge cases are carefully accounted for.
2. Datafaker for locale-based almost real-time data from data providers with extended customizable field-level validations.
3. JPA Streamer for database operations leveraging java streams.
4. Blaze persistence for entity view model DTO mapping and building complex queries with Criteria API 
5. Hoverfly for proxying the REST request facilitating Junit integration and server response mocking 

Maintaining the lifecycle of objects throughout the application and delegating the bean from the class that requires it, is performed by IoC container with a concept of Dependency Injection(DI).
The container will be responsible for supplying the bean whenever and wherever requested, ie. be it in service, data, or test layers.
Dependency Injection enriches the classes by providing the requested beans from the container that orchestrates the creation and termination of beans.
To name a few types of DI are,
Constructor Injection
Setter Injection
Autowiring by name/type
The ApplicationContext scans the classpath for annotations like Component, Repository, and Service and instantiates the beans for these classes with their class name and supplies for classes via DI if there are beans with the same name we can specify the particular bean via Qualifier or Primary annotation for resolution.
https://tanzu.vmware.com/developer/guides/dependency-injection/

Java modules enforce the definition of boundaries (based on domain-specific, design-specific, etc). Modules are evaluated both at compile time and runtime, thereby the user can have complete control over the dependencies used in module and not transitively resolve them, this promotes abstraction and accessibility protection as well as architecture evolution. By assessing the module file we can arrive at a clear architectural design documentation which can be evaluated independently.
Incremental modularization is unnamed modules, automatic modules exist in both classpath and module path. 
https://youtu.be/UqnwQp1uHuY

The JVM holds memory areas for storing the instructions, objects, references, for a program execution. Stack -> PC registry -> Per Thread data areas -> Runtime Constant Pool -> Method Area -> Heap are leveraged at different levels of program execution.
Stack - everytime a method is invoked a frame is created with method variables and stored onto the stack as reference to the frame which can reside in the Heap. For instance, recursive method calls are built on the stack 
PC Registry - stores and executes instructions 
Per Thread data area - multithreaded program execution with each thread accessing the shared memory areas 
Runtime constant pool - residing in the Method Area has symbolic references to member variables and method of classes and interfaces.
Method Area - shared data area containing the member variables and method belonging to classes and interfaces, created by the bytecode loaded by the class loader to the JVM 
Heap - holds the objects and instances, creation and management of the space is maintained by the garbage collector 
https://www.baeldung.com/java-jvm-run-time-data-areas

Creating precompiled native executables with Ahead of Time (AOT) compilation with help of GraalVM Native Image is an experimental AOT feature for the HotSpot JVM in the OpenJDK project.
As the code is precompiled the performance is enriched by natively executing the code, however, the question remains for reflective accesses, runtime property value changes, proxy invocations, and serializations that are currently being handled via RuntimeHints
https://www.baeldung.com/spring-6-ahead-of-time-optimizations

Disclaimer: 
This is a personal blog. Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in a professional or personal capacity, unless explicitly stated. Any views or opinions are not intended to malign any religion, ethnic group, club, organization, company, or individual. All content provided on this blog is for informational purposes only. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.
Downloadable Files and ImagesAny downloadable file, including but not limited to pdfs, docs, jpegs, pngs, is provided at the user’s own risk. The owner will not be liable for any losses, injuries, or damages resulting from a corrupted or damaged file.
  • Comments are welcome. However, the blog owner reserves the right to edit or delete any comments submitted to this blog without notice due to :
  • Comments deemed to be spam or questionable spam.
  • Comments including profanity.
  • Comments containing language or concepts that could be deemed offensive.
  • Comments containing hate speech, credible threats, or direct attacks on an individual or group.
The blog owner is not responsible for the content in the comments. This blog disclaimer is subject to change at any time.

Comments

Popular posts from this blog

Tech Conversant Weekly Jul 03 - Jul 15

Topic: General                                                                                                                                              Level: All Welcome to the world of cutting-edge technology! Every bi-week, we bring you the latest and most incredible advancements in the tech industry that are sure to leave you feeling inspired and empowered. Stay ahead of the game and be the first to know about the newest innovations shaping our world. Discover new ways to improve your daily life, become more efficient, and enjoy new experiences. This time, we've got some exciting news to share with you! Boosting Java startup with Class Data Sharing (CDS) https://www.youtube.com/watch?v=vvlQv1Dh-HU JDK21 LTS Maintenance and Support https://www.youtube.com/watch?v=3bfR22iv8Pc Health checking of multiple cloud applications with Spring Cloud Gateway https://spring.io/blog/2023/07/05/active-health-check-strategies-with-spring-cloud-gateway Functional Style Non-reactive HTTP clie

Tech Conversant Weekly Jun 19 - Jul 01

Topic: General                                                                                                                                              Level: All Welcome to the world of cutting-edge technology! Every bi-week, we bring you the latest and most incredible advancements in the tech industry that are sure to leave you feeling inspired and empowered. Stay ahead of the game and be the first to know about the newest innovations shaping our world. Discover new ways to improve your daily life, become more efficient, and enjoy new experiences. This time, we've got some exciting news to share with you! Modelling common behaviors between the List and the Set interface has been partially provided by LinkedHashSet. Now from JDK21 with the new interface SequencedCollection extending the Collection interface and is also extended by the List, SortedSet via SequencedSet (for reversal operation), Deque. The SequencedMap interface extends the Map interface by providing the below me

Microservices - Design Patterns

Topic: Software Design                                                                                                        Level: Intermediate Microservices - What? Microservice is a software design methodology, delegated to perform an isolated decoupled single functionality (following the Single-Responsibility Principle from object-oriented SOLID design principles).  Moreover, microservices by design, are decoupled making it easy to develop, test, maintain, deploy, configure, monitor and scale modules independently. Microservices - Why? Having one microservice would not be helpful without it being able to interact with other microservices, to aid in bringing an end-to-end business solution. So arises a question, how can I design a software system that is resilient, decentralized, fault-tolerant, scalable, maintainable, and extensible that complies with the microservice architecture? Design Patterns - What? Design patterns are solutions for commonly occurring problems within a given