Repository navigation
Expand file tree
/
Copy pathjavaAssignment.3.txt
More file actions
373 lines (223 loc) · 6.03 KB
/
Copy pathjavaAssignment.3.txt
File metadata and controls
373 lines (223 loc) · 6.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
Here’s a clear, structured breakdown of all sections. This is comprehensive but straight to the point—exactly how you’d present it in an exam or technical discussion.
---
# **SECTION A: CORE CONCEPTS**
### **1. Web Application**
A **web application** is software that runs in a browser and is accessed over the internet.
* **Difference from Desktop App:**
* Web app → runs in browser, no installation needed
* Desktop app → installed on a specific computer
---
### **2. Server**
A **server** is a system that receives requests and sends responses.
* **Role:**
* Stores data
* Runs business logic
* Responds to client (browser)
---
### **3. HTTP (HyperText Transfer Protocol)**
HTTP is the communication protocol between client and server.
* Client sends request → Server processes → Server sends response
* Works using methods like **GET, POST, PUT, DELETE**
---
### **4. Cloud System**
A **cloud system** provides computing services over the internet.
* Examples:
* Amazon Web Services
* Microsoft Azure
---
### **5. Native Application**
A **native app** is built for a specific platform (Android, iOS).
* **Difference from Web App:**
* Native → installed, faster, device-specific
* Web → browser-based, platform-independent
---
### **6. Software Architecture**
Architecture is the **structure/design of a system**.
* **Importance:**
* Scalability
* Maintainability
* Performance
---
### **7. Monolithic vs Microservices**
* **Monolithic:**
* One large system
* Hard to scale
* **Microservices:**
* Small independent services
* Easy to scale and update
---
### **8. Jakarta EE**
Jakarta EE is a platform for building enterprise web applications.
* **Importance:**
* Provides ready tools (Servlets, JPA, APIs)
* Reduces development time
* Standardized enterprise development
---
### **9. JDK**
Java Development Kit
* **Components:**
* Compiler (javac)
* JVM (Java Virtual Machine)
* Libraries (API)
---
### **10. Java vs Jakarta EE**
* **Java** = core programming language
* **Jakarta EE** = tools/framework built on Java for enterprise apps
👉 Think: Java = engine, Jakarta EE = full vehicle
---
# **SECTION B**
### **11. How HTTP Sends Request**
* Browser action → User enters URL or clicks button
* Request format:
```
GET /index.html HTTP/1.1
Host: example.com
```
* Server communication → Request sent via internet
---
### **12. Server Processing**
1. Receives request
2. Processes logic (Java code, Servlet)
3. Accesses database if needed
4. Sends response (HTML/JSON)
---
### **13. “Sign Up” Workflow**
* Frontend → user fills form
* HTTP request → POST /signup
* Backend → validates data
* Database → stores user info
* Response → success/failure message
---
### **14. Request-Response Lifecycle**
1. Client sends request
2. Server receives
3. Server processes
4. Database interaction
5. Server sends response
6. Browser displays result
---
# **SECTION C**
### **15. Jakarta EE Application Model**
* **Presentation Layer** → UI (HTML, JSP)
* **Business Layer** → logic
* **Data Layer** → database
---
### **16. Real-World Fit**
Example: Banking app
* UI → user interface
* Logic → transactions
* Data → account storage
---
### **17. Key Components**
* Servlets → handle requests
* JPA → database operations
* CDI → dependency injection
* REST → APIs
---
### **18. JPA (Java Persistence API)**
* **Problem solved:** manual SQL complexity
* **Usage:** when saving/retrieving data
---
### **19. Servlet Role**
A Servlet:
* Receives HTTP request
* Processes it
* Sends response
---
### **20. Web Container**
A web container (like Apache Tomcat):
* Manages Servlets
* Handles HTTP requests
* Provides security, lifecycle management
---
# **SECTION D**
### **21. Cloud-Native**
Apps designed to run in cloud environments.
---
### **22. Microservices**
Small independent services.
* **Importance:**
* Scalability
* Faster deployment
* Fault isolation
---
### **23. Jakarta EE & Cloud**
Supports:
* REST APIs
* Microservices
* Lightweight deployments
---
### **24. Containerization**
Using tools like Docker
* Packages app + dependencies
* Runs anywhere
---
# **SECTION E**
### **25. Install JDK & Environment Variables**
Steps:
1. Download JDK
2. Install
3. Set variables:
* **JAVA_HOME**
```
C:\Program Files\Java\jdk
```
* **PATH**
```
%JAVA_HOME%\bin
```
---
### **26. IDE**
An IDE is a development tool.
Example: Eclipse IDE
* Helps write, debug, run code
---
### **27. Eclipse Features**
1. Code auto-completion
2. Debugging tools
3. Project management
4. Plugin support
5. Syntax highlighting
---
# **SECTION F**
### **28. Banking Application Flow**
* Client → sends request
* Server → processes logic
* Jakarta EE → manages backend
* Database → stores account data
---
### **29. Without HTTP**
* No standard communication
* Systems wouldn’t understand each other
* Internet apps would break
---
### **30. Why Jakarta EE?**
Java alone:
* Low-level
Jakarta EE:
* Provides ready solutions
* Speeds development
* Standardizes enterprise apps
---
### **31. Real-Life Example (Instagram)**
(Instagram)
* **Architecture:** microservices
* **Flow:** request → API → backend → database
* **Processing:** handles images, likes, comments
---
### **32. Jakarta EE vs Spring Boot**
* Jakarta EE:
* Standardized
* Enterprise-grade
* Spring Boot:
* Faster setup
* More flexible
👉 Use:
* Jakarta EE → large enterprise systems
* Spring Boot → modern fast apps
---
### **33. HTTP/2 vs HTTP/1.1**
HTTP/2 improvements:
* Faster (multiplexing)
* Header compression
* Single connection for multiple requests