الانتقال إلى المحتوى

تعالو نروح سوا Soa ( الحلقة التاسعة )


احمد الجابري

Recommended Posts

اتوقع أن مفهوم الPersistence كان العقبة الأكبر في تعلم الناس للجي دفلوبر بشكل عام
وللADF بشكل خاص .

فماهو الPersistence

اذا كنت مبرمج بأحد لغات الNET. او PHP او PL/SQL او حتى جافا فيلزمك اعادة صياغة فهمك
لتطبيقات قواعد البيانات .

باختصار ال Persistence هو التعامل مع قواعد البيانات بالاضافة والتعديل والحذف بدون استخدام SQL
يعني تضيف بدون Insert وتعدل بدون Update و تحذف بدون جملة Delete

الان فيه سؤالين هيطفو للسطح .. الأول إزاي ؟؟ والثاني طيب ليه .. ماحنا كويسين مع الSQL ؟؟

وللجواب بنقول خلونا نتفلسف شويه .
طبعاً انتم عارفين ان لغة جافا هي لغة Object Oriented وكمان لغات الدوت نت يعني كلها كلاسات و ميثود
بالاضافة الى خصائص الOOP الاخرى مثل التوريث و الكبسلة :huh: .

اما قواعد البيانات فهي انظمة علائقية Relational تعتمد على الConstraints .

ستتضح الصورة بعد قليل مع هذا المثال :

تخيل ان لديك جدولين Employee و Department وكمان عندنا كلاسين هما Department و Employee
خلينا بس نركز على الDepartment

اذا شفنا الموضوع من ناحية قواعد البيانات هنلاقي إن جدول الأقسام يتكون من الحقول التالية
DeptID من نوع رقم
DeptName من نوع نص
و جدول الموضفين هيكون
EmpID من نوع رقم
EmpName من نوع نص
EmpDeptID عشان نربط الموظف بقسمه .

لحد الان مافيش مشاكل .

لكن لو فكرنا في نفس الموضوع من وجهة نظر مبرمج الOOP يعني بتاع الObject Oriented
بنلاقي عنده كلاسين .. كلاس الأقسام وكلاس الموظفين .
كلاس القسم فيه :
DeptID من نوع رقم
DeptName من نوع نص
Employee من نوع مجموعة من الاوبجكتات تشير إلى الكلاس Employee فهمتو ؟؟

يعني داخل الكلاس بتاع القسم فيه حقل يشير الى جميع الموظفين الخاصين بذلك القسم مربوطين بواسطة مؤشر
وليس عن طريق Constraint كما في طريقة قواعد البيانات .

كمان للتوضيح ..
لو انا شغال على قواعد البيانات وعاوز اعرف جميع الموظفين التابعين لقسم معين ..
طبعاً هفترض ان عندي في جدول الموظفين حقل اسمه EmpDeptID فيه رقم القسم اللي الموظف تابع ليه .
وبكده اقدر اقول Select * from Employee where EmpDeptID = 3 مثلاً يعني .

لكن في حالة الكلاسات الوضع اختلف وصار اكثر فاعلية يعني ممكن اوصل للموظفين بطريقة اسرع
Department(3).Employee()

فتلاحظ انه فيه اختلاف بين الرؤية بين منظور قاعدة البيانات و منظور لغات الObject Oriented
هذا الاختلاف بيسمونه impedance mismatch

نرجع للTopLink
التوبلنك هنا جايه عشان تحل الموضوع وللامانة مش هي فقط لان عندك خيارات كثيرة
عندك EJB3.0 Entity و عندك Hibernate و عندك JDO وهما اشهرها لكن باقي كثير .
وفيه من مايكروسوفت كما ذكرت في موضوع سابق عندك ال LINQ اللي جاي مع الدوت نت 3

الفكرة في الكل انك تعمل محاكاة للجدول اللي في قاعدة بيانات و تتعامل معه على انه POJO
بوجو مش بوزو المهرج طبعاً ..
بوجو يعني كلاس بسيط جدا فيه Attributes مثل EmpID و EmpName وفيه Accessors
يعني ميثود لادارة هذه الAttributes يعني بيكون فيه set و get لكل Attribute

و بعدها ننسى بشكل تماماً قاعدة البيانات و جداولها و نتعامل مع هذا البوجو كلاس ..
فإذا أنشأنا منه Object يبقى كأننا انشأنا سجل جديد في الجدول
واذا عدلنا قيم الAttributes فيه فكأننا عدلنا في الجدول عن طريق Update
واذا عملنا له remove فكأننا عملنا له Delete وهكذا ..

كذا بيكون برنامجك نظيف جدا .. يعني بدون زحمة الSQL Statement
وفوق كده ممكن تغير قاعدة بيانات في ثواني .. يعني تنقلها من اوراكل الى SQL Server مثلاً او حتى الى MySQL
بدون ماتغير سطر واحد في الكود .

هذا باختصار هو ال Persistence

موفقين .

رابط هذا التعليق
شارك

هلا والله براعي الاتصالات و مبروك عليك الشهر .

المهم خلك حولي .

رابط هذا التعليق
شارك

  • بعد 3 أسابيع...
  • بعد 2 أسابيع...
  • بعد 2 سنة...
  • بعد 2 سنة...
  • بعد 2 أسابيع...
  • بعد 4 شهور...

شرح رائع ومرتب وواضح شكراً عليه بصراحة رجعتنا لايام الكلية بالذات مفهوم ال oop والتوريث Inheritance والكبسلة capsulation وغيرها من المفاهيم حفظك الله

رابط هذا التعليق
شارك

  • بعد 1 سنة...

السلام عليكم شباب 

انا مقبل على دراسة SOA dev 

كنت عايز اعرف المحتوى بتاع الكورص دا حلو ولا لأ ولو مش كويس ايه اللي ممكن ادرسه وشكرا

 

1.Introduction to the Course and Course Contents
Describe Service-Oriented Architecture (SOA) concepts 
Details about what to download and from where for SOA 11g Installation
Technical and Business Benefits of SOA
8 case studies shall be discussed
Discussion on market value and prerequisites

2.Service-Oriented Architecture Concepts
Identify standards that enable SOA – WS, UDDI, SOAP
Review Service Component Architecture (SCA)
Describe Oracle SOA Suite 11g components
Practice
Install SOA Suite 11g and configure JDeveloper
Basic Concepts and Weblogic Server 11g - Domains, Servers, Homes
Overview Weblogic Domains and Managed Servers

3. Orchestrating Services with BPEL
Define a composite application
Describe SOA Composite Editor
Explain BPEL Components activities and partner Links

4. Synchronous and Asynchronous BPEL Processes
Orchestrating Services with BPEL
What does synchronous mean
What does asynchronous mean. What is WS-Addressing standard
Overview of Partner Link. Why do we need myRole-Partnerrole concept
Practice
Create a synchronous process
Create an asynchronous process
Using soapUI for calling and testing web services
Creating a service bottom up, containing two portTypes
Creating a service top down, containing two portTypes
Creating a service top down, containing two operations
Practice
Understand BPEL designer (JDeveloper) and activities
BPEL PM Designer Layout - the Integration Perspective
Applications and Projects (Composites)
Creating your first BPEL Process - HelloWorld
XPath Expression Builder
Deploying the BPEL Process
Managing Deployments/Un-Deployments with Enterprise Manager 11g
5. Parallel processing and Conditional branching
Creation of Java Web service from scratch (using bottom up approach)
Practice
Create Web service utilizing Google Translation API
Create Web service utilizing Google Translation API
Add multiple flows and conditions in process
Using Pick activity to start a composite using two different inputs
Using Pick activity to timeout an async call
Using Pick activity to handle multiple responses during an async call
Using onAlarm activity to raise alarms while waiting in a async call
Using While loop

6. Advanced BPEL Concepts
Describe Exception Handling in Composite Applications
Describe the Fault Management Framework and its limitations.
Describe Compensation handling within a BPEL process
Describe Correlation concepts
Using Sensors
Practice
Throwing simple faults and faults with variable
Returning faults to client by adding fault message to WSDL
Sending email on every remote fault using Fault Management Framework’s java action
Using compensation handler. 
Best practices for fault handling

7.Human Workflow
Describe Human Workflow Concepts, Features and Architecture
Design Human Tasks and Services
Invoke a Human Task from a BPEL process
Practice
Sending an approval notification
Creating a new user in Weblogic

8.Business Rules
Explain business rules concepts
Describe the Oracle Business Rules architecture
Describe Oracle Rules Engine
Create a rules with the Jdeveloper Rules Designer
Integrate a simple rule with a BPEL Process
9.Embedding Java in BPEL process
Invoking BPEL from Java
Practice
Test OBR
Use Java embedding to set/get BPEL variables, for logging
Call an external Java class, call an EXE, set title of BPEL process
Using XML Façade

10.Introduction to Binding Components
Describe the various binding components - Web service, HTTP, JCA, ADF, Direct
Describe adapter concepts and framework 
Describe Technology adapters: File, Database, JMS, etc 
Describe Applications Adapters Ebiz suite etc
Practice
Read and write a file using file adapter
HTTP Bindings
Using ADF Binding to call SOA Composite from standalone Java
Using Direct Binding to call SOA Composite from standalone Java

More Adapters Concepts
Header variables
Dynamic Partnerlinks
Externalizing properties using End point properties
Practice
Poll for new rows in a table using DB adapter
Insert data into JMS queue using JMS adapter. Download.
List Files in a directory using File adapter
Using Dynamic Partnerlinks
Using Rejection Handlers to handle erring files while reading from adapter.Download.
Making polling frequency variable for an adapter

11.Working with Mediator Components
Explain the Mediator component and its features
Define business events and the Event Delivery Network (EDN)
Create and configure a Mediator service component
Practice
Create Mediator routing rules
Raising EDN events from Enterprise Manager
Raising EDN events from PLSQL
Raising EDN events from Java
Raising EDN events from Spring
Raising EDN events from ADF
Raising EDN events from ANT

12.Monitoring and managing SOA 11g Deployment
Describe Deploy and Un-deploy SOA Composite application
Describe Management of SOA Composite application using the Enterprise Manager
Describe Deployment using ANT
Describe Configuration Plans for deploying to different environment using single codebase
Advanced Topics
Transactions
Email Setup in UMS
Validating input for a composite. Download
Adding Preferences to a composite that allow change after deployment.Download
Practice
Deploying applications having multiple composites using ANT
Using Config Plans for deploying to different environment using single codebase
Sending Email using GMAIL as SMTP server
What happens when
1. A inserts data in DB, then calls B synchronously, B creates its own transaction, B throws a error. 
2. A inserts data in DB, then calls B synchronously, B creates its own transaction, B throws a rollback error. 
3. A inserts data in DB, then calls B synchronously, B uses same transaction as A, B throws a error 
4. A inserts data in DB, then calls B synchronously, B uses same transaction as A, B throws a rollback error 
5. Insert into DB, then an unhandled error is thrown
6. Insert into DB, then dehydrate, then unhandled exception
7. Insert into DB, then select from same table. Do we see the insert
8. What if in 6, we want that the transaction should still rollback, even if it has been committed due to dehydration
9. Read JMS, insert into DB, DB fails
10. Poll DB, throw error
11. Invoke thru soap, insert into DB table 1, insert into db table 2, table 2 fails
12. Invoke thru soap, insert into DB table 1, dehydrate, insert into db table 2, table 2 fails

13.Interview Questions and Project writeups for resume
Interview Technical Questions
Interview Scenario Questions
Sample project rightups
10 Project Ideas

رابط هذا التعليق
شارك

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.
Note: Your post will require moderator approval before it will be visible.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية