View
237
Download
5
Category
Preview:
Citation preview
GRANITEDS
POVEZIVANJE JAVE I FLEXA
POMOĆU GRANITEDS-A
Eugen Božić
MIPS d.o.o.
SADRŽAJ Uvod
Analiza front-end tehnologija
Integracija JavaEE i Flexa
Što je GraniteDS
Mogućnosti GraniteDS-a
Primjer
Konfiguracije Service injectiona Entiteta Paged querya
UVOD Enterprise RIA sa modernim sučeljem
Atraktivno sučelje neovisno o preglednicima Rapid development za Java programere Stabilno, enterprise ready okruženje Bezbolna integracija sa JavaEE backendom
Predlagane front-end tehnologije
Adobe Flash / Flex HTML5 + JavaScript GWT JavaFx
ANALIZA TEHNOLOGIJA
Adobe Flex HTML5 & JS GWT JavaFXIntegracija sa JavaEE
Atraktivnost sučelja
Gotovekomponente
Learning curve
Neovisnost o pregledniku
Podrška za mobilne uređaje
ANALIZA TEHNOLOGIJAProtokoli za povezivanje JavaEE i Adobe Flex-a
SOAP Web servisi RESTful (HTTP POST) servisi Action Message Format
ANALIZA TEHNOLOGIJA
0
500
1000
1500
2000
2500
3000
3500
Primitivni tipovi Kompleksni tipovi
Liste
Web ServisiHTTP poziviAMF
INTEGRACIJA JAVAEE I FLEX-A
BlazeDS LCDS GraniteDS WebORBSinkronizacija Clinet-Server
Data push
Data Paging
Hibernate
Spring
EJB3
Generiranje Flex koda
Flex framework
Open source
ŠTO JE GRANITEDS
MOGUĆNOSTI I PREDNOSTI GRANITEDSAFlex framework (Tide) donosi JavaEE koncepte u Flex aplikaciju: dependenxy injection, context-e, autentifikaciju, bean validation...
Real-time modul (Gravity) omogućuje vrlo efikasan data push na klijentske aplikacije
Code generator (Gas3, Gfx) ubrzava repliciranje Java entitea i Java servisa u ActionScript-u
Jednostavna konfiguracija: većina konfiguracije je automatizirana putem provjere deployment enviroment-a
PRIMJER GRANITEDS KONFIGURACIJE@FlexFilter(tide = true,
type = "ejb",
factoryClass = EjbServiceFactory.class,
ejbLookup = "java:global/{capitalized.component.name}Bean",
entityManagerJndiName = "java:comp/env/persistence/mipsMpsUnit",
tideInterfaces = { EjbIdentity.class },
tideAnnotations = {RemoteDestination.class, TideEnabled .class},
tideNames = {".*Service$"}
PRIMJER SERVICE INJECTION-A
[Name("dostavaEditorContentPM", scope="conversation")]
public class DostavaEditorContentPM extends ComponentPM {
[In]
public var dostavaService:DostavaServiceRemote;
[In]
public var postonose:PagedQuery;
}
PRIMJER JAVA ENTITETA@Entity
@Table(name = "osoba", schema = "core")
public class Osoba extends AbstractEntity {
@OneToMany(mappedBy = "osoba", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Adresa> adrese;
public List<Adresa> getAdrese() {
return adrese;
}
public void setAdrese(List<Adresa> adrese) {
this.adrese = adrese;
}
...
}
PRIMJER ACTIONSCRIPT ENTITEA[Managed]
public class OsobaBase extends AbstractEntity {
[Transient]
meta var entityManager:IEntityManager = null;
private var _adrese:ListCollectionView;
[Lazy]
public function get adrese():ListCollectionView {
return _adrese;
}
...
PRIMJER PAGEDQUERY-AEjb.getInstance()
.addComponentWithFactory("postonose",
PagedQuery,
{
maxResults:30,
remoteComponentName:"dostavaService",
methodName:"getPostonosePaged",
filterClass:PostonosaDTO
}
);
PRIMJER PAGEDQUERY-A
public Map<String, Object> getPostonose(
PostonosaDTO filter,
int first, int max,
String[] order, boolean[] desc) {
Map result = new HashMap(4);
...
result.put("firstResult", first);
result.put("maxResults", max);
result.put("resultCount", resultCount);
result.put("resultList", resultList);
return result;
}
PRIMJER PAGEDQUERY-A
<mx:Script>
[In(create="true")]
public var postonosaDTO:PostonosaDTO;
[In]
public var postonose:PagedQuery;
public function search(event:MouseEvent):void {
postonose.filter = postonosaDTO;
postonose.refresh();
}
</mx:Script>
<mx:TextInput id=“imePostonose" text="{postonosaDTO.ime}"/>
<mx:Button label=“Traži" click=“search(event)"/>
<mx:DataGrid id="postonoseGrid“ dataProvider="{postonose}">
</mx:DataGrid>
PITANJA
HVALA NA PAŽNJI!
Eugen Božićeugen.bozic@mips.com.hr
MIPS d.o.o.Tuškanova 3710000 Zagreb
LINKOVI• http://artemgolubev.com/blazeds-vs-graniteds-vs-weborb-vs-livecycleds-for-business-applications-on-flex-and-java/
•http://granitedataservices.com/
•http://www.graniteds.org/public/docs/2.3.2/docs/reference/en-US/html_single/index.html
•http://www.themidnightcoders.com/products/weborb-for-net/developer-den/technical-articles/amf-vs-webservices.html
•http://graniteds.blogspot.com/2010/08/graniteds-and-glassfish-v3.html
Recommended