MoSOA Vítor Braga – [email protected]@cin.ufpe.br Marcelo Amorim –...
-
Upload
angela-gil-chagas -
Category
Documents
-
view
222 -
download
0
Transcript of MoSOA Vítor Braga – [email protected]@cin.ufpe.br Marcelo Amorim –...
MoSOAVítor Braga – [email protected]
Marcelo Amorim – [email protected] Pedro Lages – [email protected]
Roteiro• Introdução• Processo• UC02 Caso de uso Gravar Dados RMS
– Projeto do caso de uso• UC01 Chamar Serviços
– Projeto do Subsistema– Relacionamento entre Pacotes– Projeto de cápsulas do Subsistema– Execução do Subsistema
• Visão Geral da Arquitetura
Introdução
• MoSOA– Framework para Desenvolvimento de
Aplicações Móveis Orientadas a Serviços – Tecnologia Java ME (CLDC 1.1/MIDP2.0)– Open source (GPL)
http://sourceforge.net/projects/mosoa/
Processo
Projeto – UC02 Gravar Dados no RMS
• Descrição– Este caso de uso é responsável por gravar dados no
RMS. RMS é uma API que permite que aplicações MIDP mantenham seus dados armazenados localmente e persistentemente no dispositivo móvel. A vantagem do RMS é que não há restrições quanto aos tipos de dados armazenados, já que o RMS armazena sequência de bytes (records).
Projeto – UC02 Gravar Dados no RMS
• Diagrama de Sequência
/ recordStoreR1 : RecordStore
/ repositorioRecordStoreR1... : RepositorioRecordStore...
/ iRepositorioRecordStoreR1 : IRepositorioRecordStore
/ callRMSServicesControlR1 : callRMSServicesControl
/ iRMSServicesR1 : IRMSServices / aplica__o_R1
: Aplicação
1: gravarDados(record, name, offset, numBytes)1: gravarDados(record, name, offset, numBytes) 1.1: gravarDados(record, name, offset, numBytes)1.1: gravarDados(record, name, offset, numBytes)1.1.1: RecordStore rs = openRecordStore(name, true)1.1.1: RecordStore rs = openRecordStore(name, true) 2: openRecordStore(name, true)2: openRecordStore(name, true)
1.1.2: rs.addRecord(record, offset, record.length)1.1.2: rs.addRecord(record, offset, record.length)
1.1.2.1: recordID1.1.2.1: recordID
1.1.3: rs.closeRecordStore(name)1.1.3: rs.closeRecordStore(name)
1.1.4: recordID1.1.4: recordID1.2: recordID1.2: recordID
Projeto – UC02 Gravar Dados no RMS
• Diagrama de Classes
Projeto - UC01 Web Services Communication
• Descrição– Este caso de uso é responsável pela
chamada de um serviço em um determinado web services. Isso será feito de forma transparente para o desenvolvedor, ou seja, sem a necessidade de implementar as messagens trocadas com o web service.
Projeto - UC01 Web Services Communication
• Diagrama de Sequência / httpTransportR1
: HttpTransport / webServiceCommunicationControlR1... : W ebServiceCommunicationControl...
/ fachadaW ebServiceCommunicationR1... : FachadaW ebServiceCommunication...
/ iWebServiceCommunicationR2 : IWebServiceCommunication
/ serviceCallThreadR2... : ServiceCallThread
/ serviceResponseListenerR1... : ServiceResponseListener...
1: callService(W EBServiceParameters)1: callService(W EBServiceParameters)2: callService(W EBServiceParameters)2: callService(W EBServiceParameters)
3: setT imeout(timeout)3: setT imeout(timeout)
4: setResponseListener(responseListener)4: setResponseListener(responseListener)
5: createSoapEnvelop()5: createSoapEnvelop()
6: setSoapEnvelop(soapEnvelop)6: setSoapEnvelop(soapEnvelop)
7: run()7: run()
8: request(soapEnvelop)8: request(soapEnvelop)
8.1: soapObject8.1: soapObject
9: mapResponse(soapObject)9: mapResponse(soapObject)
10: processResponse()10: processResponse()
Projeto - Subsistema Web Services
Communication• Diagrama de ClassesIW ebServiceCommunication
callService()
WebServiceCommunicationControl
callService()createSoapEnvelop()
FachadaW ebServiceCommunication
1
1
1
1
SOAPEnvelope
VERSION_2_1 : intRPC_ENCODED : intDOCUMENT_LITERAL : intmultipleBodyChildren : booleanVERSION_2_2 : intclassRegister : Logical View::java::util::HashtableobjectList : Logical View::java::util::Vectormethod : Logical View::java::lang::StringnameSpace : Logical View::java::lang::Stringdebug : booleanversion : intstyle : int
(from msoapapi)
SOAPObject
getNameSpace()getType()getName()setNameSpace()setType()setName()getValue()setValue()getValueNames()
(from msoapapi)
ServiceCallThread
timeout : LongresponseListener : ServiceResponseListenersoapEnvelope : SOAPEnvelope
setTimeout()setResponseListener()setSoapEnvelop()
HTTPTransport
keepSession : booleandebug : booleanurl : Logical View::java::lang::Stringcookie : Logical View::java::lang::String
HTTPTransport()request()debug()
(from transport)
1
1
1
1
ServiceResponseListener
response : SoapResponse
processResponse()processError()mapResponse()
11
11
SoapResponse
result : HashMap
1
1
1
1
Runnable
run()
(from lang)
WEBServiceParameters
timeout : longnameSpace : StringwebServiceUrl : Stringmethod : Stringparameters : HashMapresponseListener : RespondeListener
Projeto - Subsistema Web Services
Communication• Dependência de Pacotes
W ebServiceCom munication
<<subsystem >>
i18n<<global>>
Properties
R M S ServiceControl
M SoapAPI
U I
FileIW ebServiceCom m unication
callService()
(from W ebS erviceC om m unication)
Projeto - Subsistema Web Services Communication
• Projeto de CápsulasFachadaW ebServices
+ / porta : CallService~
<<Capsule>> WebServicesControl
+ / portaFachada : CallService...+ / portaServiceThread : CallService~...
<<Capsule>>CallService
informaParametros (WebServiceParamenters)
<<Protocol>>+ / porta~
<<Port>>
+ / porta~
<<Port>>
+ / portaFachada
<<Port>>
+ / portaFachada
<<Port>>
ServiceThread
httpTransport : HttpTransportlistener : ResponseListener
+ / portaControl : CallService+ / portaTimeOut : TimeOutProtocol~...+ / portaW ebService : ResquestProtocol~...+ / NewPort1 : NewProtocol1
<<Capsule>>
HttpTransport
request()
SoapObject
T imeOut
+ / porta : T imeOutProtocol...
<<Capsule>>CallService
informaParametros (WebServiceParamenters)
<<Protocol>>
+ / portaControl
<<Port>>
+ / portaControl
<<Port>>
+ / portaServiceThread~
<<Port>>
+ / portaServiceThread~
<<Port>>
ResponseListener
responseMap()processResult()processError()
TimeOutProtocol
iniciaContagem (void)
informaTermino (void)
<<Protocol>>
+ / portaTimeOut~
<<Port>>
+ / portaTimeOut~
<<Port>>
SoapEnvelop
WebServiceParamenters
responseListener : ResponseListener
setListener()
+ / porta
<<Port>>
+ / porta
<<Port>>
SoapResponse
result : HashMap
(from W ebServiceComSubsystem)
ServiceResponseListener
response : SoapResponse
processResponse()processError()mapResponse()
<no rolename> ( SoapResponse )<no rolename> ( SoapResponse )<no rolename> ( SoapResponse )<no rolename> ( SoapResponse )
(from W ebServiceComSubsystem)
zz
1
1
zz
SoapObject(from MSoapAPI)
SOAPEnvelope(from MSoapAPI)
HttpTransport
request()
(from MSoapAPI)
1
1
Diagrama de Estados das Cápsulas (1)
• Fachada Web Services
FachadaW ebServices
+ / porta : CallS ervice~
<<Capsule>>
Diagrama de Estados das Cápsulas (2)
• Web Services Control
Diagrama de Estados das Cápsulas (3)
• Service Thread
Diagrama de Estados das Cápsulas (4)
• Service Thread
Timeout
InitialInitial
pararContagempararContagem
Estrutura das Cápsulas (Simulação)
Visão Geral do Sistema
callRMSServicesControl
rs : RecordStore
gravarDados()lerDadosRMS()apagarDadosRMS()modificarDadosRMS()
<no rolename> ( IRepositorioRecordStore )<no rolename> ( CadastroRecordStore )<no rolename> ( collectionRecordStore )<no rolename> ( collectionRecordStore )<no rolename> ( IRMSServices )<no rolename> ( IRMSServices )
(from RMS_0)
RecordStore
name : Stringrecord : byte[]
<<entity>>
(from RMS_0)
AStartMIDlet
setLanguage()startApp()destroyApp()addService()initService()
<no rolename> ( i18nService )
<<Capsule>>
i18nService
Language : StringLangFile : FilestringHashMap : HashMap
loadFile()getStringFromID()setLanguage()getLanguage()mountHash()
<no rolename> ( i18n )<no rolename> ( i18nFachada )
(from i18n)
1
11
1
AServiceMidlet
<no rolename> ( AStartMIDlet )<no rolename> ( IRMSServices )
+ / porta
<<Capsule>>
IRMSServices
gravarDadosRMS()lerDadosRMS()apagarDadosRMS()modificarDadosRMS()
<no rolename> ( callRMSServicesControl )
(from RMS_0)
1
1
1
1
11
0..*
11
0..*
FachadaWebServices
+ / porta~+ / NewPort1+ / portaService
<<Capsule>>
(from webservicesCommunication)CallService
informaParametros (WebServiceParamenters)
<<Protocol>>
(from webservicesCommunication)
WebServicesControl
+ / portaFachada+ / portaServiceThread~+ / NewPort1
<<Capsule>>
(from webservicesCommunication)
CallService
informaParametros (WebServiceParamenters)
<<Protocol>>
(from webservicesCommunication)
ServiceThread
httpTransport : HttpTransportlistener : ResponseListener
+ / portaControl+ / portaTimeOut~+ / portaWebService~+ / NewPort1
<<Capsule>>
(from webservicesCommunication)
TimeOutProtocol
iniciaContagem (void)
informaTermino (void)
<<Protocol>>
(from webservicesCommunication)
TimeOut
+ / porta
<<Capsule>>
(from webservicesCommunication)
porta
<<Port>>
porta
<<Port>>
portaFachada <<Port>>portaFachada <<Port>>
portaServiceThread<<Port>>portaServiceThread<<Port>>
portaControl<<Port>> portaControl<<Port>>portaTimeOut
<<Port>>portaTimeOut
<<Port>> porta <<Port>>porta <<Port>>
CallService
informaParametros (WebServiceParamenters)
<<Protocol>>
(from webservicesCommunication)
porta
<<Port>>
porta
<<Port>>
portaService<<Port>>
portaService<<Port>>
Visão Geral da Arquitetura
Execução
• Hands on...
Referencias
• Documentos:– http://www.cin.ufpe.br/~vtb/aps/
• Mais Informações: – http://sourceforge.net/projects/mosoa/
Dúvidas???
MoSOAVítor Braga – [email protected]
Marcelo Amorim – [email protected] Pedro Lages – [email protected]