Showing posts with label Spring _Framework. Show all posts
Showing posts with label Spring _Framework. Show all posts

Sep 19, 2023

Part2 - End-to-End data Encryption - Different methods of encryption using public and private keys

  • There are primarily three methods of encryption using public and private keys:
    1. Symmetric encryption (Private-Key Encryption)
    2. Asymmetric Encryption (Public-Key Encryption)
    3. Hybrid Encryption

Sep 13, 2023

🚀 Building and Dockerizing a Spring Boot REST API with Fabric8 Maven Plugin

1. Introduction

  • Containerization has become a pivotal aspect of contemporary software engineering, significantly impacting application development, packaging, and deployment. 
  • In this comprehensive guide, we will delve into a more intricate example by creating a Spring Boot REST API, packaging it into a Docker container through the utilization of the Fabric8 Maven Plugin, and subsequently deploying and accessing this API. 🌟

Oct 31, 2022

Spring - AOP (Aspect Oriented Programming)


In general, in enterprise applications development, if we use Object Oriented Programming languages then we have to provide the implementation by combining both the Application's business logic and services logic.


Example :

publicclassTransaction{
public void deposit(---){
----Deposit Logic-----
----Authentocation-----
----Logging------------
----Transact-----------
}
public void withdraw(---){
----Deposit Logic-----
----Authentication-----
----Logging------------
----Transact-----------
}
publicvoidtransfer(---){
----Deposit Logic-----
----Authentication-----
----Logging------------
----Transact-----------
}
}

Oct 29, 2022

Spring Expression Language – SpEL API & Example

  • Expression Language is a programming language, it will provide simplified syntaxes to manipulate Objects and their properties.

  • Example :
    • JSP EL: 
      • To evaluate the objects and their properties like request, session,application,.... and their parameters and attribuites.

    • Struts2.x OGNL: 

      • To evaluate the objects and their properties like Value Stack, CentralContext, request, application......

    • JBOSS EL: 

      • To evaluate Objects and their properties which are related to the JBOSS implementations.

    • SpEL: 

      • To evaluate bean objects and their properties in SPring applications
      • It is an Expression Language, it has provided simplified syntaxes to manipulate objects and their properties during Runtime of the applications

  • To prepare and Evaluate Expressions in SpEL, Spring has provided very good Predefined Library in the form of "org.springframework.exprssion" package.

Spring - Profiling

  • In general, in the project lifecycle, we have to perform development, testing, production mainly. At each and every phase of project lifecycle we may use databases, debugging tools, testing tools with different configuration details.
  • In general, in all project lifecycle phases we will provide the required configuration details manually, it may increase problems to the applications , in this context, Spring3.x version has provided an automated solution inorder to provide the corresponding configuration details wrt the lifecycle phases, for this, Spring framework has provided "Profiling" feature.

  • IN Project Implementation, we may use database configuration details like data source names, connection pool names, and JNDI names in Server

Spring - Property Editors

  • The main intention of the PropertyEditors is to convert data from text to Object and from Object to text.
  • In general, in J2SE, in Java Beans, PropertyEditor was originally designed to be used in Swing applications. JavaBeans specification defines API to introspect and extract the bean inner details which can be used to show bean properties visually as components and edit them by using PropertyEditors in Build Tools.
  • In Spring Applications, we will provide all values in spring configuration file as text values , but, Spring framework has to store these text values into the bean objects as the objects like Byte, Integer, String, Long,....., In this context, to convert data from textual rep-resentation to the respective objects Spring framework will use a feature "Property Editors".

Spring - Bean Manipulations or Bean Wrappers

  • In Bean Manipulation, we are able to perform the following actions.
    • 1. Getting Beans Information explicitly like properties and their setXXX() and getXXX() methods.
    • 2. Creating JavaBean Objects, checking bean property types, copying bean properties, etc.
    • 3. Accessing fields without standard getters and setters.
    • 4.Analyze and manipulate standard JavaBeans like to get and set property values, get property descriptors, and query the readability/writability of properties and setting of index properties.

Oct 28, 2022

Spring - Internationalization (I18N)

  • Designing java applications w.r.t Local Users is called Internationalization.

  • To provide Internationalization services to the users, first, we have to decide all the users into groups as per locality, for this, we have to use the following parameters.

    • 1. Language: 
      • It able to represent two lower case letters. EX: en, it, hi, .....
    • 2. Country: 
      • It will be represented in the form of two Upper case letters. EX: US, IN, IT,......
    • 3. System Varient[OS]:
      • It will be represented in the form of three lower case letters. EX: win, uni, lin,.....

Spring - Event Handling

  • In general, in GUI Applications, when we click on a button, when select an item in check boxes, radio buttons, List boxes, choice boxes ... automatically an event will be rised, where the generated event will not be handled by the respective GUI components, where the generated events are handled by some component internally called as "Listeners"[Handlers]
  • In Event Handling, the main intention of Listeners is to listen the events rised by the GUI Components, handle that events and generating results back to the GUI Applications.
  • Similarily, in spring applications, IOC Container is able to rise events when it was started, refreshed, stopped and closed. In this context, to handle the generated events Spring Framework has provided "Event Handling".

Spring - Bean Validations

  • The process of checking data validity before using data in applications is called as Data Validations.

Spring - Beans AutoWiring

  • In general, in spring applications, if we want to inject dependent values in setter method dependency injection or in constructor dependency injection we have to use <property> or <constructor-arg> tags under <bean> tag. If we want to inject simple values like primitive values, string values then we have to use "value" attribute and if we want to inject Secondary data type elements like Objects then we have to use "ref" attribute or we have to use <ref> tag in beans configuration file.
  • In spring applicatins , if we want to inject dependent bean objects to another bean object automatically with out providing <property> tags and <constructor-arg> tags then we have to use "Autowiring" feature
  • "Autowiring" feature of spring framework will make the IOC Container to inject dependent objects to the bean objects automatically on the basis of the properties names or on the basis of properties types with out checking <property> tags and <constructor-arg> tags.



There are four ways to manage auto wiring in Spring applications.

  1. XML Based Autowiring
  2. Annotation Based Autowiring
  3. Auto-Discovery[Stereo Types]
  4. Java Based Autowiring

Spring - Inversion Of Control [IOC]

1. What is Inversion Of Control?

  • In general, in enterprise applications, if we need any service in our application then we have to put a request to the service provider, where the service provider has to create the required service and then the service provider has to send that service to the respective application.
  • In enterprise applications, Inversion Of Control is a design pattern or a design principle, it will make the service provider identify the required services of the enterprise applications and it will make the service provider to create and inject the required services into the application without expecting any request from the application.
  • IOC is available in the following forms.
    • 1. Dependency Lookup 
    • 2. Dependency Injection 

Oct 27, 2022

What is bean In Spring Framework?

What is Spring Bean?

  • Bean is a Software Reusable Component, it is a normal java class contains properties and the corresponding setXXX(-) and getXXX() methods and which are created and managed by IOC Container in Spring Framework.

Spring Framework - Core Module

The main intention of IOC Container is to read bean configurations from a configuration file, create Bean objects and Provide bean Objects to Spring applications.

There are two types of IOC Containers in the Spring framework.

You may also like

Kubernetes Microservices
Python AI/ML
Spring Framework Spring Boot
Core Java Java Coding Question
Maven AWS