Basic architecture to understand the flow:
- The following diagram describes how a simple web application executes that has developed using Servlets only.
- HTML is used to take user input.
- Servlets responsibilities shown in the diagram.
- DBMS application manages the data using CRUD operations.
DTO architecture:
- DTO Stands for Data Transfer Object.
- Generally Objects will be created in Heap memory.
- Once program execution has been completed, Heap will be destroyed along with Objects, hence Objects in core-level are not permanent
- Every application should maintain information permanently either in File system or in Database.
- In some of the cases, we need to transfer object information in the network, for example in “ATM-transaction”, application need to send info from Server to Client.
- To send the object information over the network, we need to convert Object state into persistent state.
Serialization:
- Serialization is the process of saving an object state in a storage medium such as file or database.
- Persistent state is nothing but physical state.
- Serialized object can be transmitted over a network in binary form.
- This process of serializing an object is also called deflating or marshalling of an object.Java API provides some pre-defined classes to perform Serialization and Deserialization, which includes,
- java.io.Serializable(interface)
- java.io.ObjectInputStream(class)
- java.io.ObjectOutputStream(class)
DAO architecture:
- Stands for Data Access Object.
- Also called basic MVC architecture.
- “Bean” class is called “Model”.
- “JSP” is referred as “View”
- “Controller” is the Servlet.
MVC Architectural flow:
- MVC Stands for Model View Architecture.
- It is advanced to DAO architecture.
- Every web level application must follow MVC architecture rules.
- The following diagram is the simple representation of MVC.