From d224b8dfa03992f8baffc530254cc14ab8eee7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Fri, 24 May 2024 16:43:20 +0300 Subject: [PATCH] docs: update business delegate --- business-delegate/README.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/business-delegate/README.md b/business-delegate/README.md index 02ade2804..d19e6c547 100644 --- a/business-delegate/README.md +++ b/business-delegate/README.md @@ -3,7 +3,11 @@ title: Business Delegate category: Structural language: en tag: + - Business - Decoupling + - Delegation + - Enterprise patterns + - Layered architecture --- ## Intent @@ -12,13 +16,13 @@ The Business Delegate pattern adds an abstraction layer between presentation and ## Also known as -Service Representative +* Service Representative ## Explanation -Real world example +Real-world example -> A mobile phone application promises to stream any movie in existence to your device. It captures the user's search string and passes this on to the Business Delegate. The Business Delegate selects the most suitable video streaming service and plays the video from there. +> Imagine a restaurant where the waitstaff serves as intermediaries between the customers and the kitchen. When a customer places an order, the waiter takes the order to the kitchen, relays any specific requests, and later brings the prepared food back to the customer. The waitstaff abstracts the complexity of the kitchen operations from the customers, allowing the chefs to focus solely on cooking without needing to interact directly with customers. This setup allows both the customer service (presentation tier) and the kitchen (business service) to operate independently and efficiently. The waitstaff acts as the Business Delegate, managing communication and ensuring smooth interactions between the two distinct areas. In Plain Words @@ -30,6 +34,8 @@ Wikipedia says **Programmatic Example** +A mobile phone application promises to stream any movie in existence to your device. It captures the user's search string and passes this on to the Business Delegate. The Business Delegate selects the most suitable video streaming service and plays the video from there. + First, we have an abstraction for video streaming services and a couple of implementations. ```java @@ -135,11 +141,7 @@ Here is the console output. ## Class diagram -![alt text](./etc/business-delegate.urm.png "Business Delegate") - -## Related patterns - -* [Service locator pattern](https://java-design-patterns.com/patterns/service-locator/) +![Business Delegate](./etc/business-delegate.urm.png "Business Delegate") ## Applicability @@ -152,7 +154,7 @@ Use the Business Delegate pattern when ## Tutorials -* [Business Delegate Pattern at TutorialsPoint](https://www.tutorialspoint.com/design_pattern/business_delegate_pattern.htm) +* [Design Patterns - Business Delegate Pattern (TutorialsPoint)](https://www.tutorialspoint.com/design_pattern/business_delegate_pattern.htm) ## Known Uses @@ -180,5 +182,6 @@ Trade-offs: ## Credits -* [J2EE Design Patterns](https://www.amazon.com/gp/product/0596004273/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596004273&linkCode=as2&tag=javadesignpat-20&linkId=48d37c67fb3d845b802fa9b619ad8f31) -* [Core J2EE Patterns: Best Practices and Design Strategies](https://www.amazon.com/gp/product/0130648841/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=javadesignpat-20&creative=9325&linkCode=as2&creativeASIN=0130648841&linkId=a0100de2b28c71ede8db1757fb2b5947) +* [Core J2EE Patterns: Best Practices and Design Strategies](https://amzn.to/4cAbDap) +* [J2EE Design Patterns](https://amzn.to/4dpzgmx) +* [Patterns of Enterprise Application Architecture](https://amzn.to/3WfKBPR)