mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-08-05 20:22:43 +00:00
docs: updates to several patterns
This commit is contained in:
@@ -19,11 +19,11 @@ The Client Session design pattern aims to maintain a user's state and data acros
|
||||
|
||||
## Explanation
|
||||
|
||||
Real-World Example
|
||||
Real-world example
|
||||
|
||||
> A real-world example of the Client Session pattern is a library membership system. When a member logs in, the system starts a session to track their borrowing activities. This session holds data such as the member's ID, current borrowed books, due dates, and any fines. As the member browses the catalog, borrows books, or returns them, the session maintains this stateful information, ensuring the member's interactions are consistent and personalized until they log out or the session expires. This approach helps the library system manage user-specific data efficiently across multiple interactions, providing a seamless and personalized experience for the members.
|
||||
|
||||
In Plain words
|
||||
In plain words
|
||||
|
||||
> The Client Session pattern manages user-specific data across multiple requests within a web application to maintain continuity and personalization.
|
||||
|
||||
@@ -37,8 +37,6 @@ The Client Session design pattern is a behavioral design pattern that maintains
|
||||
|
||||
In the given code, we have a `Server` class and a `Session` class. The `Server` class represents the server that processes incoming requests and assigns sessions to clients. The `Session` class represents a session that is assigned to a client.
|
||||
|
||||
Here's a programmatic example of the Client Session design pattern using the given code:
|
||||
|
||||
```java
|
||||
// The Server class represents the server that processes incoming requests and assigns sessions to clients.
|
||||
public class Server {
|
||||
|
||||
Reference in New Issue
Block a user