Chapter5-Solving Integration Problems Using Patterns
Chapter5-Solving Integration Problems Using Patterns
Chapter5-Solving Integration Problems Using Patterns
Middleware - Recap
• Middleware is any type of software that facilitates
communication between two or more software
systems
• تايجمربال ةمظنأ نم رثكأ وأ نينثا نيب لصاوتال لهست يتال تايجمربال نم عون يأ وه ةطيسوال
– Can be simple communication connection between applications
– تاقيبطتال نيب طيسب الصتا الصتا نوكي نأ نكمي
– Can be as sophisticated as information sharing and logic
execution mechanismsق طنمال ذيفنتال ت ايآلو ت امولعمال ل دابتل ثم ةروطتم ن وكتن أ ن كمي
• Middleware is a technology that allows us to move
information between multiple systems that may reside
within and outside an organization دقي تال ةددعتمال ةمظنألا ن يبت امولعمال ل قنلانلحمستي تال ايجولونكتال
ي ه ة طيسوال
ةمظنمال جراخو لخاد ةدوجوم نوكت
int bytesSent =
socket.Send(amount); bytesSent +=
socket.Send(name;)
;)(socket.Close • Code opens a socket connection to the address
www.boa.com and sends two data items (the amount
and the customer’s name) across the network.
• When we run this code it tells us: “7 bytes sent الصتا حتفدوك.”
ناونع ىإل ذخأمwww.boa.com ةكبشال ربع )ليمعال مساو غلبمال( تانايبال رصانع نم نينثا لسريو.
." انلل وقيوه زمرال اذه ل يغشتبموقنامدنع: "7ت لسرأ ت ياب
Tight Coupling Example Assumptions
• This minimalist integration solution is fast and cheap, but it results in a very brittle solution because the two
participating parties make the following assumptions about each other ةصيخرو ة عيرس وه ى ندألا دحال ل ماكتال ل حال, هنكلو
ض عبال اهضعبن ع ةيالتال ت اضارتفالا ل عجتةكراشمال ب ازحألا ن م ن ينثا ن أل ةياغللش ه ل ح ى إل ي دؤي : اذه
– Platform Technology – internal representations of numbers and objects ايجولونكتةصنم-ءايشألاو ماقرألا ن م ةيلخادال ل يثامت
• 32bit vs 64 bit internal representation32 ي لخادال ل يثمتال ل باقم ت ب64ت ب
• A system using 64 bits would be inclined to read 8 bytes off the network and would endup interpreting the whole
message (including the customername) as a single number مادختسابماظن64 ةءارقلل يمين وكيست ب8ةكبشال جراخ ت ياب, ف وسو
ي
. امب ةلماك ةالسرال ريسفتي هتن
( دحاو مقرك )ل يمعال مسا ك لذ ي ف
– Location – hard-coded machine addresses عقوم- اهنيولتت باثال زاهجال ن يوانع
• Remote functions and machine location are hard-coded. Any change in anything, we would have to change
code. If we use a lot of remote functions this could become very tediousدعب, اهنيولت ت باثال ي ه ةآل ن اكمالو. ي أ ي فرييغتي أ
ءي ش,زمرال رييغتلانيدلن وكيس. ادج ةلمم حبصتن أ ن كمياذه دعبن ع ف ئاظو ن م ريثكال مادختسا اندرأ اذإ. ن ع ف ئاظو
– Time – all components have to be available at the same time ت قولا- تقوال س فني فةحاتم ن وكتن أ ب جيت انوكمال ل ك
• Establishing a TCP connection requires that both machines and the network are all availableat the same time
ال صتا.س يسأتTCPت قوال س فني فحاتم وه ام ل ك ةكبشو ت الآ ن م ال ك ن أ ب لطتي
– Data Format – the list of parameters and their types must match ت انايبال ق يسنت-ق باطتتن أ ب جياهع اونأو ت املعم ةمئاق
• If we want to insert a third parameter, e.g. the name of the currency, we would have to modify both sender and
receiver to use the new data format ةثالثال ةملعمال جاردإ ن أ ديرنانك اذإ, ال ثمال ل يبسى لع, ةلمعال مسا, ي قلتمالو ل سرمال ن م ل ك ل يدعتلانيدلن أ
.
.ةديدجال ت انايبال ق يسنتمادختسال
• Coupling is a measure of how many assumptions parties make about each other when they communicate. Our
simple solution requires the parties to make a lot of assumptions. Therefore, this solution is tightly coupled .
ل صاوتال امدنع ض عبال اهضعبن ع ف ارطألا ل عجت ت اضارتفالا ددعلس ايقم وه ن ارتقا. ت اضارتفالا ن م ريثكال ل عجلن يفرطال ب لطتيطيسبل ح انيدل.ك لذل, ل حال اذه ن رتقيو
Loosely coupled solution
• Instead, we can develop
loosely coupled solution by
using a message-oriented
middleware
(MOM) infrastructure ك لذ ن م,ةدعابتمال ل ح عضو اننكمي
ةالسر ةهجومال ةطيسوال مادختساب( ال دبMOM) ةيتحتال ةينبال
• Content Enricher: when the target system requires data fields that
the originating system cannot supply. It has the ability to look up
missing information or compute it from the available data ف دهال ماظنال ب لطتي
ى وتحمال ي رثمال: امدنع.
ضرعال نأ نكمي ال اهؤشنم ماظنال نأ تانايبال لوقح. ةحاتمال تانايبال نم كلذ باسح وأ ةصقانال تامولعمال نع ثحبلل ةردقال هيدل نمف
• Content Filter: removes unwanted data from a messageى وتحمال ةيفصت: ل يزي.
ةالسر نم اهيف بوغرمال ريغ تانايبال
messages
."ال رابتخالا ت حتت انوكمال اياقب ل ئاسر ن وقلتي
"
Things that make up Middleware: Endpoint
Identified
Requirements:
• Interactions between
– 1and 4
– 2and 5
– 3and 6
6 ,5 ,4 –and 7
Message
Channel
Router
Integration Solution – Set of Patterns for the
requirements: ل حال ل ماكت- ت ابلطتمللطامنأ ن م ةعومجم
• Message
– Document Message or Event Messageةالسر ث دح وأ ةقيث Transformatio
ةالسر n
– Document message would be best fit ن وكيةقيثوال ةالسر ن ا
ب سنألا Endpoint
– Point-to-Point
Channel
• Channel
System
Endpoint • Management
– Messaging
Second Requirement
Message
Channel
Router
Integration Solution – Set of Patterns for the
requirements:
• Message
– Document Message Transformatio
n
• Channel
– Point-to-Point Channel
– Channel Adapter Endpoint
System
Management
Third Requirement
Message
Channel
Router
Integration Solution – Set of Patterns for the
requirements:
• Message
– Document Message Transformatio
n
• Channel
– Point-to-Point Channel
Channel Adapter – Endpoint
System
Management
Fourth Requirement
Message
Channel
Router
Transformatio
n
Integration Solution – Set of Patterns for the
requirements:
• Message Endpoint
– Document Message
• Channel System
– Datatype Channel Management
Develop Integration Solutions for Process Orders