SlidePub
Home
Categories
Login
Register
Home
Technology
Integrative Programming languaege Module.pdf
Integrative Programming languaege Module.pdf
shumawakjira26
8 views
37 slides
Sep 18, 2025
Slide
1
of 37
Previous
Next
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
About This Presentation
Integrative Programming Module PDF FOR DEGREE PROGRM
Size:
480.09 KB
Language:
en
Added:
Sep 18, 2025
Slides:
37 pages
Slide Content
Slide 1
IntegrativeProgramming
Page1
CHAPTER1
IntroductiontoIntegrativeProgramming&Technologies
CourseLearningOutcome:
Attheendofthesemester,thestudentswillbeableto:
1.DiscusstheIntroductiontoIntegrativeProgrammingandTechnologies;
2.Explainintegrativetechnologiesormethodsusedinapplicationintegration;and
3.Evaluatethedifferenttypesofmiddlewareandhowthemiddlewaresolvesproblemof
heterogeneity.
Definition:
Integrationofsoftwarereferstotechniquesforcombiningexistingsoftware
componentstoformacompletesystem.
However,thesoftwareintegrationincludesatleastoneexistingsoftwaresystem,
developedinthepastwithnoplanforitssymmetricintegrationwithanother
componentinthefuture.
Integrativeprogrammingdealswithanintegrationapproachesandtechniquesthat
connectdifferentcomponentsofITinfrastructure-
People,
Applications,
Platformsand
Databasestoenableasecure,intraandinterapplicationcollaboration.
Integrativesolutionsenableanorganizationtointegratebusinessprocessesinternallyand
externallywithbusinesspartnerstocreatedynamicenvironmentsthatsupportscurrent
andevolvingbusinessrequirements,therebycreatingaglobalorganization.
Applicationintegrationassistsinunlimitedsharingofdataandbusinessprocesses
amonganyconnectedapplicationsordatasourcesinwithoutmakingmajorchanges
totheapplicationsordatastructures.
Integrationistheprocessofconnectingmultiple,independentlydevelopedapplications
usingincompatibletechnologiesintoasingleorganizationwidesystemwithinformation
flowingseamlesslyamongtheintegratedsystemsorcomponents.
Slide 2
IntegrativeProgramming
Page2
Mostoftheapplicationsthatruninorganizations’hardlyliveinisolation.
Whethertheregistrarapplicationmustinterfacewiththefinanceapplication,
thehumanresourcemanagementapplicationmustconnecttoeachother,it
seemslikeanyapplicationcanbemadebetterbyintegratingitwithother
applications.
Integrationofmultiple,independentlydeveloped,managedandmaintainedapplications
componentsthatmaynormallyuseincompatibletechnologiesandheterogeneous
platforms”
Enablestransmissionofinformationbetweenapplications,
Automatesflowofdatabetweenapplicationsthatmakeupthebusinessprocessflow.
Integrationistheprocessofcombiningseparateapplicationsintocooperating
collectionsofapplication.
Overviewofintersystemcommunication
Inter-systemcommunicationisthecommunicationbetweenasetofheterogeneous
systemsthatareintegratedtogether.
Theseintegratedsystemswhichputtogethermanyheterogeneoussetof
subsystemsandtheproducedobjectsareextremelydifferent,yetshould
contributetothesameprocess.
Softwareintegrationincludesoneormoreofthefollowing.
1.Systemintegration
Giventwoormoresystems,subsystemsorcomponents,eachofwhichfunction
properly(satisfyingtheirrequirementwithintheirenvironment).
Theproblemistointegratethemintoonelargersystemsatisfyingthecombined
requirementswithinthenewlyformedenvironment.
2.Functionalintegrationortechnologyintegration
Givenasoftwaresystem,thismayhavebeenfunctioningproperlyinthefieldfora
significantperiod.
Theproblemistointegrateanewfunctionoranewtechnologywithinthesystem.
Theintegratedsystemshouldprovidethenewfunctionalityorusethenew
technology,whilepreservingtheoriginalsystemfunctionality.
Slide 3
IntegrativeProgramming
Page3
3.Incrementalengineering
Asoftwaresystemcanbedevelopedanddeliveredusingavailabletechnologiesand
withlessfunctionalitythanitisintendedtofinallyprovide.
Newtechnologiesandormorefunctionsthencanbeintegratedwithinthesystem.
Theproblemistodesignthesystemwithsuchfutureintegrationinmind.
4.Modification
Sometimesanexistingandproperlyfunctioningsoftwaresystemmustbe
decomposedandintegratedtocarryoutmodification.
Theneedforintegration
Mostoforganizationsconsistofmorethanonedepartment,runningdepartment
specificapplicationsandthoseapplicationsinteractwitheachothertoachievethe
overallobjectiveoftheorganizations.
Informationsystemschangeovertimebygrowingintheirsize,incorporating
functionalityoftheexistingstandalonesystems.
Applicationsoriginallyintendedtooperateseparately,lateronarerequiredto
interoperatewithothers.
Someofthereasonsforintegrationarethefollowing;
•Technologychangeaffectsalllayers;legacydoesnotgoawaysoeasily.
•Thearchitectureoftheorganizationinformationsystemdependsonconstraints
relatedtothetechnologybutalsototheorganization.
•Withinanenterprise,eachdepartmentmayhaveitsownITinfrastructure,
systemsanddatabaseswhicharemaintainedindependently.
Integratingthemmaybringadditionalvaluetothecompany.
•IntegrationassistsinformationofZeroLatencyorganization-whenall
functionswithintheorganizationworkwiththesameup-to-dateinformation,
latencybetweenapplicationsiseliminated/reduced.
•Updatingandintegratingofapplicationsispossiblewheneverrequired.New
applicationscanbecreatedbyintegratingrealtimedatafromdifferentpartsof
theenterprise
Slide 4
IntegrativeProgramming
Page4
Integrationmodels
Integrationmodeldefineshowapplicationswillbeintegratedbydefiningthenature
ofandmechanismsforintegration.
Someofthemethodsusedforapplicationintegrationarediscussedinthefollowing
section.Thesemodelsinclude;
1.Presentationintegration
2.Dataintegrationand
3.Functionintegration
1.Presentationintegrationmodel
Allowstheintegrationofnewsoftwarethroughtheexistingpresentationsofthe
legacysoftware.
Thisistypicallyusedtocreateanewuserinterfacebutmaybeusedtointegrate
withotherapplications.
2.Dataintegrationmodel
Allowstheintegrationofsoftwarethroughaccesstothedatathatiscreated,
managedandstoredbythesoftwaretypicallyforthepurposesofreusingor
synchronizingdataacrossapplications.
3.Functionalintegrationmodel
Allowstheintegrationofsoftwareforthepurposeofinvokingexisting
functionalityfromotherneworexistingapplications.
Theintegrationisdonethroughinterfacestothesoftware.
FundamentalChallengesofIntegration
Tosupportcommonbusinessprocessesanddatasharingacrossapplications,these
applicationsneedtobeintegrated.
Applicationintegrationneedstoprovideefficient,reliableandsecuredataexchange
betweenmultipleenterprisesapplications.
AlotoftheproblemstobeaddressedinOrganizationsApplicationIntegrationsystem
fromhavingtointegratestandaloneapplicationswhichhavebeen
Slide 5
IntegrativeProgramming
Page5
Developedindependently,
Operateautonomously,and
Werenotoriginallyindentedtobeintegratedwithoneanother.
Integrationofapplications,developedbydifferentlanguagesandrunningondifferent
computingplatformsisnotaneasytask.
Bydefinition,integrationhastodealwithmultipleapplicationsrunningonmultiple
platformsindifferentlocations,makingtheterm‘simpleintegration’prettymuch
difficult.
Softwarevendorsofferapplicationintegrationsuitesthatprovidecross-platform,cross-
languageintegrationaswellastheabilitytointerfacewithmanypopularpackaged
businessapplications.
However,thistechnicalinfrastructurepresentsonlyasmallportionofthe
integrationcomplexities.
Thetruechallengesofintegrationspanfaracrossbusinessandtechnicalissues.
Allintegrationsolutionshavetodealwithafewfundamentalchallenges:someofthe
challengesofintegrationare;
Networkunreliability
Distributedsystems
Slownetworksand
Heterogeneity
Modificationcomplexity
1.Networkisunreliable.
Integrationsolutionshavetotransportdatafromonecomputertoanotheracross
networks.
Comparedtoaprocessrunningonasinglecomputer,distributedcomputinghas
tobepreparedtodealwithamuchlargersetofpossibleproblems.
Oftentimes,twosystemstobeintegratedareseparatedbycontinentsanddata
betweenthemhastotravelthroughphone-lines,LANsegments,routers,
switches,publicnetworks,andsatellitelinks.
Eachofthesestepscancausedelaysorinterruptions.
Slide 6
IntegrativeProgramming
Page6
2.Distributed–
Intheworstcase,everyapplicationrunsonacompletelyseparateenvironment,
E.g.databasestorageisnotsharedamongapplications.
Message-basedcommunicationistheonlypossibilitytoexchangeinformation.
3.Networksareslow.
Sendingdataacrossanetworkismultipleordersofmagnitudeslowerthan
makingalocalmethodcall.
Designingawidelydistributedsolutionthesamewayyouwouldapproacha
singleapplicationcouldhavedisastrousperformanceimplications
4.Anytwoapplicationsaredifferent.
Integrationsolutionsneedtotransmitinformationbetweensystemsthatuse
differentprogramminglanguages,operatingplatforms,anddataformats.
Anintegrationsolutionneedstobeabletointerfacewithallthesedifferent
technologies.
Heterogeneous–eachapplicationimplementsitsowndatamodel.
Conceptsmaybeshared,butrepresentationmismatchesaretobeexpected.
Mappingsandtransformationsarerequired.
5.Changeisinevitable.
Applicationschangeovertime.
Anintegrationsolutionhastokeeppacewithchangesintheapplicationsit
connects.
Integrationsolutionscaneasilygetcaughtinanavalancheeffectofchanges–if
onesystemchanges,allothersystemsmaybeaffected.
Anintegrationsolutionneedstominimizethedependenciesfromonesystemto
anotherbyusingloosecouplingbetweenapplications.
Autonomous–applicationsupdatetheirstateindependentlywithoutcoordinating
witheachother.
Slide 7
IntegrativeProgramming
Page7
Thesystemstobeintegratedaremaintainedindependentlyandupgradedat
differenttimes.
IntegrativeTechnologies/methodsforintegration
Applicationintegrationisanintegrationframeworkcomposedofacollectionof
technologiesandserviceswhichformamiddlewareor"middlewareframework"to
enableintegrationofsystemsandapplicationsacrossorganizations.
Therearefourmethodsusedinapplicationintegration,whicharediscussedinthesection
below:
1.FileTransfer-
Oneapplicationwritesafilethatanotherlaterreads.
Theapplicationsneedtoagreeonthefilenameandlocation,theformatofthe
file,thetimingofwhenitwillbewrittenandread,andwhowilldeletethefile.
2.SharedDatabase-
Multipleapplicationssharethesamedatabaseschema,locatedinasingle
physicaldatabase.
Becausethereisnoduplicatedatastorage,nodatahastobetransferredfrom
oneapplicationtotheother.
3.RemoteProcedureInvocation–
Oneapplicationexposessomeofitsfunctionalitysothatitcanbeaccessed
remotelybyotherapplicationsasaremoteprocedure.
Thecommunicationoccursreal-timeandsynchronously.
4.Messaging–
Oneapplicationpublishesamessagetoacommonmessagechannel.
Otherapplicationscanreadthemessagefromthechannelatalatertime.
Theapplicationsmustagreeonachannelaswellastheformatofthemessage.
Thecommunicationisasynchronous(onebyonecommunication)example
usingATMmachine.
Allofthefourapproachessolveessentiallythesameprobleminintegration;
eachstylehasitsdistinctadvantagesanddisadvantages.
Slide 8
IntegrativeProgramming
Page8
Infact,applicationsmayintegrateusingmultiplestylessuchthateachpointof
integrationtakesadvantageofthestylethatsuitsitbest.
Filetransfer
Anorganizationnaturally,runsmultipleapplicationsthatarebeingbuilt
independently,withdifferentlanguagesandplatforms.
Howcanweintegratemultipleapplicationssothattheyworktogetherandcanexchange
informationandinteractwitheachother?Theanswerforthisquestionisgivenbelow;
Oneofthepossiblesolutionstoallowtheseapplicationstobeintegratedis
allowingeachapplicationproducefilescontaininginformationthatother
applicationsneedtoconsume.
Integratorstaketheresponsibilityoftransformingfilesintodifferentformats.
Producethefilesatregularintervalsaccordingtothenatureofthebusiness,
whichcanbeconsumedorreadbyanotherfile.
Animportantdecisionwithfilesiswhatformattouse.
Veryrarelywilltheoutputofoneapplicationbeexactlywhat'sneededfor
another,soyou'llhavetodoafairbitofprocessingoffilesalongtheway.
Notjustdoalltheapplicationsthatuseafilehavetoreadit,youalsohavetobeableto
useprocessingtoolsonit.
SharedDatabase
Acommondatabasecanbeusedforintegratingapplications.
Asinglephysicaldatabasecanbesharedbydifferentapplicationsrunningondifferent
platforms.
Slide 9
IntegrativeProgramming
Page9
Thismethodintegratesapplicationsbyhavingthemstoretheirdatainasingleshared
database.
Ifafamilyofintegratedapplicationsallrelyonthesamedatabase,thenwecanbepretty
surethattheyarealwaysconsistentallofthetime.
Ifwedogetsimultaneousupdatestoasinglepieceofdatafromdifferentsources,then
wehavetransactionmanagementsystemsthathandlethataboutasgracefullyasitever
canbemanaged.
Remoteprocedurecalls
Thismethoddevelopseachapplicationwhichisrequiredtobeintegratedasalarge-
scaleobjectorcomponentwithencapsulateddataanditprovidesaninterfaceto
allowotherapplicationstointeractwiththerunningapplication.
RemoteProcedureInvocationappliestheprincipleofencapsulationtointegrating
applications.
oIfanapplicationneedssomeinformationthatisownedbyanotherapplication,it
asksthatapplicationdirectly.
oIfoneapplicationneedstomodifythedataofanother,thenitdoessobymakinga
calltotheotherapplication.
oEachapplicationcanmaintaintheintegrityofthedataitowns.
Slide 10
IntegrativeProgramming
Page10
Furthermore,eachapplicationcanalteritsinternaldatawithouthavingeveryother
applicationbeaffected.
Messaging
Messagingallowsinteractionbetweenapplicationspossible.
Messagepassingcanbeusedtotransferpacketsofdatafrequently,immediately,
reliably,andasynchronously,orsynchronouslyusingcustomizableformats.
Asynchronousmessagingisfundamentallyapracticalreactiontotheproblemsof
distributedsystems.
Sendingamessagedoesnotrequirebothsystemstobeupandreadyatthe
sametime.
Furthermore,thinkingaboutthecommunicationinanasynchronousmanner
forcesdeveloperstorecognizethatworkingwitharemoteapplicationisslower,
whichencouragesdesignofcomponentswithhighcohesion(lotsofworklocally)
andlowadhesion(selectiveworkremotely).
Thereasonamessagingsystemisneededtomovemessagesfromonecomputerto
anotheristhatcomputersandthenetworksthatconnectthemareinherentlyunreliable.
Justbecauseoneapplicationisreadytosendacommunicationdoesnotmeanthat
theotherapplicationisreadytoreceiveit.
Evenifbothapplicationsareready,thenetworkmaynotbeworking,ormayfailto
transmitthedataproperly.
Amessagingsystemovercomestheselimitationsbyrepeatedlytryingtotransmitthe
messageuntilitsucceeds.
Slide 11
IntegrativeProgramming
Page11
Underidealcircumstances,themessageistransmittedsuccessfullyonthefirsttry,but
circumstancesareoftennotideal.
Inessence,amessageistransmittedinfivesteps:
1.Create-thesendercreatesthemessageandpopulatesitwithdata.
2.Send-thesenderaddsthemessagetoachannel.
3.Deliver-themessagingsystemmovesthemessagefromthesender’scomputerto
thereceiver’scomputer,makingitavailabletothereceiver.
4.Receive-thereceiverreadsthemessagefromthechannel.
5.Process-thereceiverextractsthedatafromthemessage.
Thisdiagramillustratesthesefivetransmissionsteps,whichcomputerperformseach,and
whichstepsinvolvethemessagingsystem:
Thisdiagramalsoillustratestwoimportantmessagingconcepts:
1.Sendandforget–
Instep2,thesendingapplicationsendsthemessagetothemessagechannel.
Oncethatsendiscomplete,thesendercangoontootherworkwhilethe
messagingsystemtransmitsthemessageinthebackground.
Slide 12
IntegrativeProgramming
Page12
Thesendercanbeconfidentthatthereceiverwilleventuallyreceivethe
messageanddoesnothavetowaituntilthathappens.
2.Storeandforward–
Instep2,whenthesendingapplicationsendsthemessagetothemessagechannel,
themessagingsystemstoresthemessageonthesender’scomputer,eitherin
memoryorondisk.
Instep3,themessagingsystemdeliversthemessagebyforwardingitfromthe
sender’scomputertothereceiver’scomputer,andthenstoresthemessageonce
againonthereceiver’scomputer.
Thisstore-and-forwardprocessmayberepeatedmanytimes,asthemessageis
movedfromonecomputertoanother,untilitreachesthereceiver’scomputer.
MiddlewareandIntegrativearchitectures
Middlewareisasoftwareprogrammingrunningatthetopofoperatingsystemand
belowtheapplications.
Itconnectsapplicationsorsoftwarecomponents.
Middlewareprovidesastandardhighlevelinterfacetotheapplicationdevelopers
andintegrators,sothatapplicationcaneasilyinteroperate.
Interoperabilityistheabilityoftwoormorecomponentsorsystemstoexchange
information.
Slide 13
IntegrativeProgramming
Page13
Therearethreetypesofmiddleware.Theseare,transaction-oriented,object-oriented
andmessageorientedmiddleware.
1.Transaction-orientedmiddleware:supportsdistributedcomputinginvolving
databaseapplications.
2.Message-orientedmiddleware:supportsreliable,asynchronous
communicationsbetweendistributedcomponentsorapplications.
3.Object-orientedmiddleware:systemsarebasedonobject-orientedparadigm,
andprimarilysupportsynchronouscommunicationsbetweendistributedobjects
orsoftwarecomponents.ExamplesareCORBA,DCOMandRMI.
Integrativearchitectures
Integrativearchitecturesarethestandardmethodologiesforapplicationintegration.
Thesearchitecturesinclude,CORBA,DCOMandRPC.
Thearchitecturesactasamiddleware,asoftwareapplicationthatmediatesbetween
differentapplications.
CommonObjectRequestBrokerArchitecture
CORBAisasoftwarestandardthatisdefinedandmaintainedbytheObjectManagement
Group(OMG).
TheCommonObjectRequestBrokerArchitecture(CORBA)isastandardarchitecture
foradistributedobjectssystem.
CORBAisdesignedtoallowdistributedobjectstointeroperateinaheterogeneous
environment,whereobjectscanbeimplementedindifferentprogramminglanguage
and/ordeployedondifferentplatforms.
Slide 14
IntegrativeProgramming
Page14
DCOM
Distributedcomponentobjectmodel-extendstheCOMtosupportcommunication
betweenobjects.
DCOMisasoftwarearchitectureorremoteprotocolthatdefinesabinarystandardfor
componentinteroperability.
DCOMisasoftwarearchitecturethatallowsapplicationstobebuiltfrombinarysoftware
components.
Isbinaryinterfacestandardforsoftwarecomponents,thatallowsinter-process
communication.
Binaryinterfaceisaprograminterfacebetweenbinaryprogrammodulesoftenoneofthe
moduleislibraryoroperatingsystemandtheotherisuserprogrammodule.
Defineshowcomputationalroutinesarecalledinmachinecodeorlow-levelwhichis
hardwareindependent
Slide 15
IntegrativeProgramming
Page15
ReviewQuestions
1.Defineintegrativeprogramming?
2.Explainthearchitecturesusedinapplicationintegration?
3.Describeinteroperability?
4.Whatarethechallengesinapplicationintegrationdescribethesolutionsto
overcomethechallenges?
5.DescribethedifferencebetweenCORBAandRMIorremotemethodinvocation?
6.Explainintegrativetechnologiesormethodsusedinapplicationintegration?
7.Whatisthedifferencebetweendatalevelandfunctionlevelintegrationmodel?
Whichmodelismorecomplexandwhy?
8.Whatisheterogeneity?
9.Describedifferenttypesofmiddlewareanddescribehowthemiddlewaresolves
problemofheterogeneity?
Slide 16
IntegrativeProgramming
Page16
CHAPTER2
WebServicesandMiddleware;Networkprogramming;Lowleveldata
communicationsMessageandqueuingservices
CourseLearningOutcome:
Attheendofthesemester,thestudentswillbeableto:
1.DescribetheWebServicesandMiddleware;
2.IdentifythepartsofNetworkProgramming;and
3.Modifyalowleveldatacommunicationsmessageandqueuingservices.
WebServicesandMiddleware
Applicationintegrationtechnology
Allowsapplicationstobeintegratedmorerapidly,easilyandlessexpensively.
Program-to-programinteractionswhereaswebforprogram-to-userinteractions.
Allowcompaniestoreducethecostofdoinge-business,todeploysolutionsfasterand
toopenupnewopportunities.
Webservicesmodelbuiltonemergingstandardssuchas
HTTP
XML
SimpleObjectAccessProtocol(SOAP)
WebServicesDescriptionLanguage(WSDL)
UniversalDescription,DiscoveryandIntegration(UDDI)
Developedinordertodistributeanobjectandserveittovarioususersintheweb
environments.
Usedintheserversituationswhilesolvingtheweb-scalabilityproblemoftheother
distributedobjecttechnologies.
WSDLandSOAPexploitXML.
WSDLisanXMLdescribingthewebservice.
SOAPisanXMLdescribingthecalledmethod,itsparameters,anditsreturnvalue,
canbedeliveredovertheHTTP
Slide 17
IntegrativeProgramming
Page17
WebServicesandMiddleware
1.Aclientthatwantstobeservicedshouldfirstfindthesupportedservicesfromthepre-
existingregistrybeforecompilingacode.
2.Afterfindingitsservicesthroughsearching,theclientgainstheWebService
DescriptionLanguage(WSDL)thataserverpreviouslyregisters.
FromtheWSDL,theclientknowstheserviceproviderlocationandthe
parameterstothefoundmethod.
3.Aftertheclientbindsthedescribedserviceduringthecompiletime,itcallsthelocal
agentwhenevertheclientinvokesamethodcall,andthelocalagentdeliversittothe
serversideagentthroughSimpleObjectAccessProtocol(SOAP)overHTTP,FTP,
SMTP,andTCPduringtheruntime.
4.Theserversideagentactivatestheappropriateobject,anddeliversthecallstotheobject.
NetworkProgramming
Network:
Anetworkisacollectionofcomputersandotherdevicesthatcansenddatatoand
receivedatafromeachother.
Slide 18
IntegrativeProgramming
Page18
Anetworkisoftenconnectedbywires.
However,wirelessnetworkstransmitdatathroughinfraredlightand
microwaves.
Node:
Eachmachineonanetworkiscalledanode.
Mostnodesarecomputers,butprinters,routers,bridges,gatewaysetc.canalso
benodes.
Nodesthatarefullyfunctionalcomputersarealsocalledhosts.
Packet:
Allmoderncomputernetworksarepacket-switchednetworks:datatravelingon
thenetworkisbrokenintochunkscalledpacketsandeachpacketishandled
separately.
Eachpacketcontainsinformationaboutwhosentitandwhereit'sgoing.
Protocol:
Aprotocolisaprecisesetofrulesdefininghowcomputerscommunicate:the
formatofaddresses,howdataissplitintopackets.
IP:
IPwasdesignedtoallowmultipleroutesbetweenanytwopointsandtoroute
packetsofdataarounddamagedrouters.
TCP:
Sincetherearemultipleroutesbetweentwopointsandthepacketsthatmakeupa
particulardatastream.
Furthermore,theymaynotarriveintheordertheyweresent,iftheyevenarriveat
all.
UDP:
UDPisunreliableprotocolsthatdoesnotguaranteethatpacketswillarriveat
theirdestinationorthattheywillarriveinthesameordertheyweresent.
Ports:
EachcomputerwithanIPaddresshasseveralthousandlogicalports.
Eachportisidentifiedbyanumberbetween1and65,535.
Slide 19
IntegrativeProgramming
Page19
Eachportcanbeallocatedtoaparticularservice.
Portnumbers1through255arereservedbyIPforwell-knownservices.
Ifyouconnecttoport80ofahost,forinstance,youmayexpecttofindanHTTP
server.
Internet:
LargestIP-basednetworkforconnectingmachinestogether.
Java:easy-to-use,cross-platformmodelfornetworkcommunications.
WhatisaSocket?
SocketsareameansofusingIPtocommunicatebetweenmachines,sosocketsallow
Javatointeroperatewithlegacysystemsbysimplytalkingtoexistingserversusingtheir
pre-definedprotocol.
Internetprotocol:UserDatagramProtocol(UDP)andTransmissionControlProtocol
(TCP).
InternetAddressesorIPAddresses
Everynetworknodehasanaddress,aseriesofbytesthatuniquelyidentifyit.
InternetaddressesaremanipulatedinJavabytheuseoftheInetAddress
class.InetAddresstakescareoftheDomainNameSystem(DNS)look-upand
reverselook-up;
IPaddressescanbespecifiedbyeitherthehostnameortherawIPaddress.
InetAddressprovidesmethodstogetByName(),getAllByName(),getLocalHost(),
getAddress(),etc.
IPaddressesarea32-bitnumber,oftenrepresentedasa"quad"offour8-bitnumbers
separatedbyperiods.
Theyareorganizedintoclasses(A,B,C,D,andE).
Forexample126.255.255.255Client/ServerComputing-Javalanguage
communicatewithremotefilesystem.
HowUDPclientsandUDPserverscommunicateoversocketsCreatingUDP
Servers:
TocreateaserverwithUDP,dothefollowing:
1.CreateaDatagramSocketattachedtoaport.
Slide 20
IntegrativeProgramming
Page20
intport=1234;
DatagramSocketsocket=newDatagramSocket(port);
2.Allocatespacetoholdtheincomingpacket,andcreateaninstanceof
DatagramPackettoholdtheincomingdata.
byte[]buffer=newbyte[1024];
DatagramPacketpacket=newDatagramPacket(buffer,buffer.length);
3.Blockuntilapacketisreceived,thenextracttheinformationyouneedfromthe
packet.
//Blockonreceive()
socket.receive(packet);
//Extractthepacketdata
byte[]data=packet.getData();
//Findoutwherepacketcamefrom
//sowecanreplytothesamehost/portInetAddressremoteHost=
packet.getAddress();intremotePort=packet.getPort();
CreatingUDPClients
1.Firstallocatespacetoholdthedatawearesendingandcreateaninstanceof
DatagramPackettoholdthedata.
byte[]buffer=newbyte[1024];
intport=1234;
InetAddresshost=InetAddress.getByName("magelang.com");
DatagramPacketpacket=newDatagramPacket(buffer,buffer.length,host,
port);
2.CreateaDatagramSocketandsendthepacketusingthissocket.
DatagramSocketsocket=newDatagramSocket();//freelocalporttouse
socket.send(packet);
//FindoutwherewearesendingfromInetAddresslocalHostname=
socket.getLocalAddress();intlocalPort=socket.getLocalPort();
HowTCPclientsandTCPserverscommunicateoversocketsCreatingTCPServers:
TocreateaTCPserver,dothefollowing:
1.CreateaServerSocketattachedtoaportnumber.
Slide 21
IntegrativeProgramming
Page21
ServerSocketserver=newServerSocket(port);
2.Waitforconnectionsfromclientsrequestingconnectionstothatport.
//Blockonaccept()
Socketchannel=server.accept();
You'llgetaSocketobjectasaresultoftheconnection.
3.Getinputandoutputstreamsassociatedwiththesocket.
out=newPrintWriter(channel.getOutputStream());out.println("Hey!I
heardyouoverthissocket!");
reader=newInputStreamReader(channel.getInputStream());in=new
BufferedReader(reader);
Nowyoucanreadandwritetothesocket,thus,communicatingwiththeclient.
Stringdata=in.readLine();
CreatingTCPClients:
TocreateaTCPclient,dothefollowing:
1.CreateaSocketobjectattachedtoaremotehost,port.
Socketclient=newSocket(host,port);
Whentheconstructorreturns,youhaveaconnection.
2.Getinputandoutputstreamsassociatedwiththesocket.
out=newPrintWriter(client.getOutputStream());out.println("Watson!"+
"Comehere...Ineedyou!");
reader=newInputStreamReader(client.getInputStream());in=new
BufferedReader(reader);
Nowyoucanreadandwritetothesocket,thus,communicatingwiththeserver.
Stringdata=in.readLine();
LowLevelDataCommunication
TCP/IP(TransmissionControlProtocol/InternetProtocol)
oTheProtocoluponwhichthewholeInternetisbased
oEachnodemustbeconfiguredforTCP/IPtofunctionproperly.
oAsoftware-basedprotocol
oTCP/IPisbasicallythebindingtogetherofInternetProtocolsusedtoconnect
hostsontheinternet-MainonesareIPandTCP
Slide 22
IntegrativeProgramming
Page22
oTCPandIPhavespecialpacketstructure
oIP(InternetProtocol)isresponsiblefordeliveringpacketsofdatabetweensystems
ontheinternetandspecifiestheirformat.Packetsforwardedbasedonafourbyte
destinationIPaddress(IPnumber)IPDOESNOTMAKEGUARANTEES!Itis
verysimple-essentially:sendandforget.
oTCP(TransmissionControlProtocol)isresponsibleforverifyingthecorrect
deliveryofdata/packetsfromclienttoserver.Datacanbelost.SoTCPalsoadds
supporttodetecterrorsandretransmitdatauntilcompletelyreceived.
IPPacketStructure
Version-IndicatestheversionofIPcurrentlyused.
IPHeaderLength(IHL)-Indicatesthedatagramheaderlengthin32-bitwords.
Type-of-Service-Specifieshowanupper-layerprotocolwouldlikeacurrentdatagram
tobehandled,andassignsdatagramvariouslevelsofimportance.
Slide 23
IntegrativeProgramming
Page23
TotalLength-Specifiesthelength,inbytes,oftheentireIPpacket,includingthedataand
header.
Identification-Containsanintegerthatidentifiesthecurrentdatagram.Thisfieldis
usedtohelppiecetogetherdatagramfragments.
Flags-Consistsofa3-bitfieldofwhichthetwolow-order(least-significant)bitscontrol
fragmentation.Thelow-orderbitspecifieswhetherthepacketcanbefragmented.The
middlebitspecifieswhetherthepacketisthelastfragmentinaseriesoffragmented
packets.Thethirdorhigh-orderbitisnotused.
FragmentOffset-Indicatesthepositionofthefragment’sdatarelativetothebeginningof
thedataintheoriginaldatagram,whichallowsthedestinationIPprocesstoproperly
reconstructtheoriginaldatagram.
Time-to-Live-Maintainsacounterthatgraduallydecrementsdowntozero,atwhich
pointthedatagramisdiscarded.
Protocol-Indicateswhichupper-layerprotocolreceivesincomingpacketsafterIP
processingiscomplete.
HeaderChecksum-HelpsensureIPheaderintegrity.
SourceAddress-Specifiesthesendingnode.
DestinationAddress-Specifiesthereceivingnode.
Options-AllowsIPtosupportvariousoptions,suchassecurity.
Data-Containsupper-layersentinpacket.
TCPPacketStructure
Slide 24
IntegrativeProgramming
Page24
Thereare12fieldsinTCPPacket:
SourcePortandDestinationPort-Identifiespointsatwhichupperlayersource
anddestinationprocessesreceiveTCPservices.
SequenceNumberIntheconnection-establishmentphase,thisfieldalsocanbe
usedtoidentifyaninitialsequencenumbertobeusedinanupcoming
transmission.
AcknowledgmentNumber-Containsthesequencenumberofthenextbyteof
datathesenderofthepacketexpectstoreceive.
DataOffset-Indicatesthenumberof32-bitwordsintheTCPheader.
Reserved-Remainsreservedforfutureuse.
Slide 25
IntegrativeProgramming
Page25
Flags-Carriesavarietyofcontrolinformation,includingtheSYNandACKbits
usedforconnectionestablishment,andtheFINbitusedforconnection
termination.
Window-Specifiesthesizeofthesender’sreceivingwindow(thatis,thebuffer
spaceavailableforincomingdata).
Checksum-Indicateswhethertheheaderwasdamagedintransit.
UrgentPointer-Pointstothefirsturgentdatabyteinthepacket.
Options-SpecifiesvariousTCPoptions.
Data-Containsupper-layersentinpacket.
Slide 26
IntegrativeProgramming
Page26
Chapter3
DataMappingandExchange
CourseLearningOutcome:
Attheendofthesemester,thestudentswillbeableto:
1.DiscussDataMappingandExchange;
2.DefineaComplexElementusingXMLScheme;and
3.CreateXMLSchemasbyUsingXMLSchema-CreationTools.
XMLDTDandXMLSchema
HowdoesanXMLprocessorcheckyourxmldocument?
TherearetwomainchecksthatXMLprocessorsmake:
1.Checkingthatyourdocumentiswell-formed(Syntaxrule)
2.Checkingthatit'svalid(syntax-checkyourXMLeitherinXMLDTDorXSD)
DTD-DocumentTypeDefinition
XSD-XMLSchemaDefinition
WhyneedXMLValidator
UseourXMLvalidatortosyntax-checkyourXML.
ErrorsinXMLdocumentswillstopyourXMLapplicationsunlikeHTMLbrowser
XMLDTD
AnXMLdocumentwithcorrectsyntaxiscalled"WellFormed".
AnXMLdocumentvalidatedagainstaDTDis"WellFormed"and"Valid".
ThepurposeofaDTDistodefinethestructureofanXMLdocumentandalistof
legalelements.
HowyouaddaDTDtoourXMLdocument
1.DTDscanbeseparatedocuments(or)
2.TheycanbebuiltintoanXMLdocumentusingaspecialelementnamed<!DOCTYPE>.
AnXMLDocumentwithaDTD(example4.xml)
<?xmlversion="1.0"encoding="UTF-8"?>
<?xml-stylesheettype="text/css"href="css1.css"?>
Slide 27
IntegrativeProgramming
Page27
<!DOCTYPEdocument
[
<!ELEMENTdocument(heading,message)>
<!ELEMENTheading(#PCDATA)>
<!ELEMENTmessage(#PCDATA)>
]>
<document>
<heading>HelloFromXML</heading>
<message>ThisisanXMLdocument!</message>
</document>
ValidXMLDocumentwithDTD(example.5.xml)
TheDOCTYPEdeclarationisareferencetoanexternalDTDfile"Note.dtd“
<?xmlversion="1.0"encoding="UTF-8"?>
<!DOCTYPEnoteSYSTEM"Note.dtd">
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don'tforgetmethisweekend!</body>
</note>
Note.dtd
<!DOCTYPEnote[
<!ELEMENTnote(to,from,heading,body)>
<!ELEMENTto(#PCDATA)>
<!ELEMENTfrom(#PCDATA)>
<!ELEMENTheading(#PCDATA)>
<!ELEMENTbody(#PCDATA)>
]>
TheDTDaboveisinterpretedlikethis:
!DOCTYPEnotedefinesthattherootelementofthedocumentisnote
Slide 28
IntegrativeProgramming
Page28
!ELEMENTnotedefinesthatthenoteelementcontainsfourelements:"to,from,
heading,body"
!ELEMENTtodefinesthetwoelementtobeoftype"#PCDATA"
!ELEMENTfromdefinesthefromelementtobeoftype"#PCDATA"
!ELEMENTheadingdefinestheheadingelementtobeoftype"#PCDATA"
!ELEMENTbodydefinesthebodyelementtobeoftype"#PCDATA“
Note
#PCDATAmeansparse-abletextdata.
WhenNOTtoUseaDocumentDefinition?
WhenyouareworkingwithsmallXMLfiles,creatingdocumentdefinitionsmaybea
wasteoftime.
XMLSchema
AnotherwayofvalidatingXMLdocuments:usingXMLschemas.
TheXMLSchemalanguageisalsoreferredtoasXMLSchemaDefinition(XSD),
describesthestructureofanXMLdocument.
Definesthelegalbuildingblocks(elementsandattributes)ofanXMLdocumentlike
DTD.
defineswhichelementsarechildelements
definesthenumberandorderofchildelements
defineswhetheranelementisemptyorcanincludetext
definesdatatypesforelementsandattributes
definesdefaultandfixedvaluesforelementsandattributes
XMLSchemaswillbeusedinmostWebapplicationsasareplacementforDTDs.Herearesome
reasons:
XMLSchemasareextensibletofutureadditions
XMLSchemasarericherandmorepowerfulthanDTDs
XMLSchemasarewritteninXML
XMLSchemassupportdatatypesandnamespaces
CreatingXMLSchemasbyUsingXMLSchema-CreationTools
HiTSoftware
Slide 29
IntegrativeProgramming
Page29
xmlArchitect
XMLspy
XMLRay
MicrosoftVisualStudio.NET
XSDSimpleElement
Thesyntaxfordefiningasimpleelement
DefaultandFixedValuesforSimpleElements
XSDAttributes
Thesyntaxfordefininganattribute
DefaultandFixedValuesforAttributes
OptionalandRequiredAttributes
XSDComplexElements
HowtoDefineaComplexElementusingXMLScheme
XSDEmptyElements
XSDIndicators
Orderindicatorsare:
All
Choice
Sequence
XSDSimpleElement
AsimpleelementisanXMLelementthatcancontainonlytext.
Itcannotcontainanyotherelementsorattributes.
XMLSchemahasalotofbuilt-indatatypes.Themostcommontypesare:
1.xs:string
2.xs:decimal
3.xs:integer
4.xs:boolean
5.xs:date
6.xs:time
Thesyntaxfordefiningasimpleelementis:
<xs:elementname="xxx"type="yyy"/>
Example
<lastname>Refsnes</lastname>
Slide 30
IntegrativeProgramming
Page30
<age>36</age>
<dateborn>1970-03-27</dateborn>
<xs:elementname="lastname"type="xs:string"/>
<xs:elementname="age"type="xs:integer"/>
<xs:elementname="dateborn"type="xs:date"/>
DefaultandFixedValuesforSimpleElements
Simpleelementsmayhaveadefaultvalueorafixedvaluespecified.
1.Adefaultvalueisautomaticallyassignedtotheelementwhennoothervalueis
specified.
<xs:elementname="color"type="xs:string"default="red"/>
2.Afixedvalueisalsoautomaticallyassignedtotheelement,andyoucannot
specifyanothervalue.
<xs:elementname="color"type="xs:string"fixed="red"/>
XSDAttributes
Simpleelementscannothaveattributes.
Ifanelementhasattributes,itisconsideredtobeofacomplextype.Buttheattribute
itselfisalwaysdeclaredasasimpletype.
Thesyntaxfordefininganattributeis:
<xs:attributename="xxx"type="yyy"/>
Example
<lastnamelang="EN">Smith</lastname>
<xs:attributename="lang"type="xs:string"/>
DefaultandFixedValuesforAttributes
Attributesmayhaveadefaultvalueorafixedvaluespecified.
<xs:attributename="lang"type="xs:string"default="EN"/>
<xs:attributename="lang"type="xs:string"fixed="EN"/>
OptionalandRequiredAttributes
Attributesareoptionalbydefault.Tospecifythattheattributeisrequired,usethe"use"
attribute:
<xs:attributename="lang"type="xs:string"use="required"/>
XSDComplexElements
Slide 31
IntegrativeProgramming
Page31
AcomplexelementisanXMLelementthatcontainsotherelementsand/orattributes.
Therearefourkindsofcomplexelements:
Example:
1.AcomplexXMLelement,"product",whichisempty:<productpid="1345"/>
2.AcomplexXMLelement,"employee",whichcontainsonlyotherelements:
<employee>
<firstname>John</firstname>
<lastname>Smith</lastname>
</employee>
3.AcomplexXMLelement,"food",whichcontainsonlytext:
<foodtype="dessert">Icecream</food>
4.AcomplexXMLelement,"description",whichcontainsbothelementsandtext:
<description>
Ithappenedon<datelang=“EN">03.03.99</date>
</description>
HowtoDefineaComplexElementusingXMLScheme
ComplexXMLelement,"employee",whichcontainsonlyotherelements:
<employee>
<firstname>John</firstname>
<lastname>Smith</lastname>
</employee>
The"employee"elementcanbedeclareddirectlybynamingtheelement:
<xs:elementname="employee">
<xs:complexType>
<xs:sequence>
<xs:elementname="firstname"type="xs:string"/>
<xs:elementname="lastname"type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Anemptycomplexelementcannothavecontents,onlyattributes.
Slide 32
IntegrativeProgramming
Page32
<productprodid="1345"/>
Itispossibletodeclarethe"product"elementmorecompactly:
<xs:elementname="product">
<xs:complexType>
<xs:attributename="prodid"type="xs:positiveInteger"/>
</xs:complexType>
</xs:element>
XSDIndicators
Howelementsaretobeusedindocumentswithindicators.
Orderindicatorsareusedtodefinetheorderoftheelements.Theyare:
1.All
2.Choice
3.Sequence
AllIndicator:
The<all>indicatorspecifiesthatthechildelementscanappearinanyorder,andthat
eachchildelementmustoccuronlyonce:
<xs:elementname="person">
<xs:complexType>
<xs:all>
<xs:elementname="firstname"type="xs:string"/>
<xs:elementname="lastname"type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
ChoiceIndicator:
The<choice>indicatorspecifiesthateitheronechildelementoranothercanoccur:
<xs:elementname="person">
<xs:complexType>
<xs:choice>
<xs:elementname="employee"type="employee"/>
<xs:elementname="member"type="member"/>
Slide 33
IntegrativeProgramming
Page33
</xs:choice>
</xs:complexType>
</xs:element>
SequenceIndicator:
The<sequence>indicatorspecifiesthatthechildelementsmustappearinaspecificorder:
<xs:elementname="person">
<xs:complexType>
<xs:sequence>
<xs:elementname="firstname"type="xs:string"/>
<xs:elementname="lastname"type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
XMLExample(“note.xml”)
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don'tforgetmethisweekend!</body>
</note>
XSDExample(“note.xsd”)
<xs:elementname="note">
<xs:complexType>
<xs:sequence>
<xs:elementname="to"type="xs:string"/>
<xs:elementname="from"type="xs:string"/>
<xs:elementname="heading"type="xs:string"/>
<xs:elementname="body"type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Slide 34
IntegrativeProgramming
Page34
Example(shiporder.xml):
<?xmlversion="1.0"encoding="ISO-8859-1"?>
<shiporderorderid="889923">
<orderperson>JohnSmith</orderperson>
<shipto>
<name>OlaNordmann</name>
<address>Langgt23</address>
<city>4000Stavanger</city>
<country>Norway</country>
</shipto>
</shiporder>
Example"shiporder.xsd":
<?xmlversion="1.0"encoding="ISO-8859-1"?>
<xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:elementname="shiporder">
<xs:complexType>
<xs:sequence>
<xs:elementname="orderperson"type="xs:string"/>
<xs:elementname="shipto">
<xs:complexType>
<xs:sequence>
<xs:elementname="name"type="xs:string"/>
<xs:elementname="address"type="xs:string"/>
<xs:elementname="city"type="xs:string"/>
<xs:elementname="country"type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attributename="orderid"type="xs:string"use="required"/>
</xs:complexType>
Slide 35
IntegrativeProgramming
Page35
</xs:element>
</xs:schema>
XMLParser(ParsingXMLdocuments)
Allmodernbrowsershaveabuilt-inXMLparser.
AnXMLparserconvertsanXMLdocumentintoanXMLDOMobjectwhichcan
thenbemanipulatedwithJavaScript.
ParseanXMLDocument
ThefollowingcodefragmentparsesanXMLdocumentintoanXMLDOMobject:if
(window.XMLHttpRequest)
{//codeforIE7+,Firefox,Chrome,Opera,Safarixmlhttp=newXMLHttpRequest();
}
else
{//codeforIE6,IE5
xmlhttp=newActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","books.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
XMLDOM
TheXMLDOMdefinesastandardwayforaccessingandmanipulatingXMLdocuments.
TheXMLDOMviewsanXMLdocumentasatree-structure.
AllelementscanbeaccessedthroughtheDOMtree.
Theircontent(textandattributes)canbemodifiedordeleted,andnewelementscanbe
created.
Theelements,theirtext,andtheirattributesareallknownasnodes.
TheHTMLDOM
TheHTMLDOMdefinesastandardwayforaccessingandmanipulatingHTML
documents.
AllHTMLelementscanbeaccessedthroughtheHTMLDOM.
Slide 36
IntegrativeProgramming
Page36
LoadanXMLFile-Cross-browser
parsesanXMLdocument("note.xml")intoanXMLDOMobjectandthenextractssome
informationfromitwithaJavaScript:
Example
<html>
<body>
<spanid="to"></span>
<spanid="from"></span>
<spanid="message"></span>
<script>
if(window.XMLHttpRequest)
{
//codeforIE7+,Firefox,Chrome,Opera,Safarixmlhttp=newXMLHttpRequest();
}
else
{
//codeforIE6,IE5
xmlhttp=newActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","note.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.getElementById("to").innerHTML=
xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue;
document.getElementById("from").innerHTML=
xmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue;
document.getElementById("message").innerHTML=
xmlDoc.getElementsByTagName("message")[0].childNodes[0].nodeValue;
</script>
</body>
Slide 37
IntegrativeProgramming
Page37
</html>
Tags
integrative programming modul
Categories
Technology
Download
Download Slideshow
Get the original presentation file
Quick Actions
Embed
Share
Save
Print
Full
Report
Statistics
Views
8
Slides
37
Age
84 days
Related Slideshows
11
8-top-ai-courses-for-customer-support-representatives-in-2025.pptx
JeroenErne2
63 views
10
7-essential-ai-courses-for-call-center-supervisors-in-2025.pptx
JeroenErne2
60 views
13
25-essential-ai-courses-for-user-support-specialists-in-2025.pptx
JeroenErne2
46 views
11
8-essential-ai-courses-for-insurance-customer-service-representatives-in-2025.pptx
JeroenErne2
47 views
21
Know for Certain
DaveSinNM
29 views
17
PPT OPD LES 3ertt4t4tqqqe23e3e3rq2qq232.pptx
novasedanayoga46
32 views
View More in This Category
Embed Slideshow
Dimensions
Width (px)
Height (px)
Start Page
Which slide to start from (1-37)
Options
Auto-play slides
Show controls
Embed Code
Copy Code
Share Slideshow
Share on Social Media
Share on Facebook
Share on Twitter
Share on LinkedIn
Share via Email
Or copy link
Copy
Report Content
Reason for reporting
*
Select a reason...
Inappropriate content
Copyright violation
Spam or misleading
Offensive or hateful
Privacy violation
Other
Slide number
Leave blank if it applies to the entire slideshow
Additional details
*
Help us understand the problem better