CiklumJavaSat_15112011:Alex Kruk VMForce


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Idea?No hardwareNo softwareNo technical team…..
  • CiklumJavaSat_15112011:Alex Kruk VMForce

    1. 1.
    2. 2. Introduction in VMForce<br />by Alex Kruk<br />Skype: alexandrkruk<br />Email:<br />
    3. 3.
    4. 4. PARX – ABOUT US<br />Leading Google Enterprise and consulting partner in German-speaking Europe<br />comprehensive Cloud Computing Services from a single source<br />servicesacrosstheentirevaluechain: consulting, conception, specifications, development, implementation, training, support, projectmanagement<br />offices in Zurich, Munich, Dusseldorf and Vienna<br />founded in 1998<br />
    5. 5. PARX – ABOUT US<br />Strategic alliances<br />Google Enterprise Partner<br /> Consultuing Partner<br />Amazon Web Services,, GoodData & Signavio<br />PARX was among the first, Google Enterprise, and Amazon Web Services partners in Europe<br />
    6. 6. PARX – PORTFOLIO<br />
    7. 7. Progress... Join us<br />1960s<br />Mainframe<br />1980s<br />On-Premise<br />Client/server<br />Today<br />Enterprise Cloud Computing<br />
    8. 8. The cloud computing model<br />Multi-tenant<br />Automatic Upgrades<br />Pay-as-you-go<br />Real-time<br />5x Faster<br />
    9. 9.<br />
    10. 10. FORCE.COM - PAAS<br />
    11. 11. FORCE.COM components<br />
    12. 12. VMFORCE is coming?<br />
    13. 13. SDK<br />Use to store your application data<br />Interact with data already written to <br />Leverage the user security model to manage data access for your application <br />Extend existing applications with Java logic<br />
    14. 14. SDK components<br />API Connector<br />JPA Provider<br />OAuth Authentication and Authorization<br />Spring Security Plugin<br />Spring MVC Project Template<br />Code Generation Plugin<br />
    15. 15. JPA provider<br />Implements a subset of the JPA 2.0 specification<br />Based on DataNucleus platform<br />Supports most of DN annotations + some custom.<br />Supports additional functionality (SOQL, etc.)<br />Based on Web Services API and Metadata API<br />
    16. 16. API COnnector<br /><persistence-unit name="forceDatabase"><br /> <provider>com.force.sdk.jpa.PersistenceProviderImpl</provider><br /> <properties><br /> <property name="datanucleus.storeManagerType" value="force" /><br /> <property name="datanucleus.connectionURL" value="${CONN_URL}" /><br /> <property name="datanucleus.autoCreateSchema" value="true" /><br /> <property name="datanucleus.validateTables" value="false" /><br /> <property name="datanucleus.validateConstraints" value="false" /><br /> <property name="datanucleus.Optimistic" value="false" /><br /> <property name="datanucleus.datastoreTransactionDelayOperations"<br /> value="true" /><br /> <property name="datanucleus.jpa.addClassTransformer" value="false" /><br /> <property name="datanucleus.cache.level2.type" value="none" /><br /> <property name="datanucleus.detachAllOnCommit" value="true" /><br /> <property name="datanucleus.copyOnAttach" value="false" /><br /> </properties><br /> </persistence-unit><br />
    17. 17. JPA provider<br />Data types. Standard + custom (Phone, URL, etc.)<br />Primary Keys. String, GenerationType.IDENTITY, non-composit.<br />Relationships. @ManyToOne and @OneToMany<br />Standard/Custom annotations<br />Transactions<br />Queries<br />Limits<br />
    18. 18. Standard/Custom annotations<br />Standard JPA annotations<br />Custom JPA annotations<br />@CustomObject (enableFeeds, readOnlySchema )<br />@CustomField (childRelationshipName, description, label, precision, scale, type, etc…)<br />@PicklistValue<br />@JoinFilter (alias="w", value=" LIKE 'Chateau%'")<br />
    19. 19. Creating, Updating, and Deleting Data<br />EntityManagerFactory factory = Persistence.createEntityManagerFactory(persistenceUnitName);<br />EntityManagerem = factory.createEntityManager();<br />AlbomanAlbom = new Albom();<br />anAlbom.setName("ABC");<br />EntityTransactiontx = em.getTransaction();<br />tx.begin();<br />em.persist(anAlbom);<br />tx.commit();<br />
    20. 20. Querying with JPQL<br />EntityManagerFactoryaFactory = Persistence.createEntityManagerFactory(persistenceUnitName);<br />EntityManagerem = aFactory.createEntityManager();<br />String aQuerySt = "SELECT acc FROM Account acc WHERE u.Name = :fName";<br />Query aQuery = em.createQuery(aQuerySt);<br />aQuery.setParameter("fName", "noname");<br />List<Account> results = (List)aQuery.getResultList();<br />
    21. 21. Querying with JPQL<br />Bulk Delete and Queries<br />JPQL Date (Temporal) Functions<br />JPQL Joins<br />Implicit Joins<br />Explicit Joins (SELECT p FROM Parent p JOIN p.childsc WHERE = ‘examp’)<br />IN Joins (SELECT p FROM Parent p IN (o.childs) c WHERE = 'sample1')<br />Semi-Joins and Anti-Joins <br />Child-Map Joins<br />Relationship Joins (SELECT c FROM Child c WHERE in ('Parent1', 'Parent2'))<br />MEMBER OF Comparison Operator<br />
    22. 22. Querying with SOQL<br />Returning Typed-Object Records<br />String aQS= "SELECT Email, Phone FROM Account WHERE Name = ‘Apple'";<br />Query aQ= em.createNativeQuery(soqlQuery);<br />List<SObject> results = q.getResultList();<br />Returning SObject Records<br />Query aQuery= em.createNativeQuery(soqlQuery, User.class);<br />List<User> results = aQuery.getResultList();<br />Relationship Queries<br />String aQS= "SELECT id, name, (SELECT id, Name FROM Parent_Childs__r)” + + “FROM Parent__c";<br />Query aQuery= em.createNativeQuery(aQS, Parent.class);<br />List<SObject> results = aQuery.getResultList();<br />ArrayList<ChildEntity> childs = (ArrayList<Child>) results.get(0).getChilds();<br />
    23. 23. OAuth Authentication<br /><filter><br /> <filter-name>AuthFilter</filter-name><br /> <filter-class>com.force.sdk.oauth.AuthFilter</filter-class><br /> <init-param><br /> <param-name>url</param-name><br /> <param-value>URL or a ${Java system property} or ${environment variable}</param-value><br /> </init-param><br /></filter><br /><filter-mapping><br /> <filter-name>AuthFilter</filter-name><br /> <url-pattern>/*</url-pattern><br /></filter-mapping><br />
    24. 24. OAuth Authentication<br />Filter parameters<br />securityContextStorageMethod<br />secure-key-file<br />storeUsername<br />logoutFromDatabaseDotCom<br />logoutUrl<br />Spring Security Support<br />
    25. 25. Other<br />Limits (DBDC,, SDK)<br />Native connections<br />Retrieving User Data<br />Spring MVC Project Template<br />Code Generation Plugin<br />
    26. 26. Bye-bye laptop<br />
    27. 27. Hello world<br />Maven 3.0<br />Get instance.<br />Open API access to user, get security token<br />mvnarchetype:generate -DarchetypeGroupId=com.force.sdk<br /> -DarchetypeArtifactId=springmvc-archetype<br />FORCE_FORCEDATABASE_URL=force://^&password=mypassAndSS<br />mvntomcat:run-war<br />
    28. 28. Hello world<br />Add oAuth<br />Add Entities files.<br />Use Code Generation Plugin<br />Perform SOQL/JPQL queries.<br />Add/modify data using Transactions<br />
    29. 29. Founded in 2008,<br />Initially PaaS for Ruby.<br />Now supports Ruby, Node.js, Clojure, Python, and Scala.<br />Since September 2011 supports Java.<br />
    30. 30. What do we need?<br />Maven 3.0<br />JDK 1.6+<br />Heroku account<br />Installed Herokuenv. (inc.Git, Foreman)<br />Java application built on Maven.<br />
    31. 31. Next step<br />Configure application using pom.xml<br />Configure Procfileto declare how you want your application executed<br />web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war<br />Run locally. “foreman start”<br />“gitadd .”<br />git commit -m “Are you sure???“<br />heroku create --stack cedar<br />git push heroku master<br />
    32. 32. Heroku is awesome <br />Built-for-Deployment Applications<br />Version Control is the Central Distribution Mechanism.<br />No Need to Externalize Configuration From Your Code<br />Deployment is a Highly Automated Pipeline Process<br />How do Applications use JEE APIs Without a Container?<br />Servlets and JSPs by Tomcat or Jetty.<br />JSF and other rendering frameworks by Mojarra or MyFaces<br />Mail services by SendGrid.<br />JDBC to connect to HerokuPostgres service or Amazon RDS<br />Hibernate or DataNucleus JPA to provide an ORM persistence <br />
    33. 33. Heroku is awesome <br />Deployment “gitpush herokumaster”<br />Start/Stop/Restart “herokurestart”<br />Deployment of Changes<br />Clustering (scaling) “heroku scale web=2 worker=4”<br />Load-balancing<br />Logging<br />
    34. 34. Something else about heroku<br />Dyno???<br />Isolation by subvirtualization technologies<br />One request at a time<br />512MB of memory<br />Web/worker dynos.<br />$0.05 per hour<br />Payment<br />Dynos<br />Database<br />Add-ons<br />
    35. 35. THANK YOU!<br /> SDK<br />HEROKU for Java<br />by Alex Kruk<br />Skype: alexandrkruk<br />Email:<br />