Your SlideShare is downloading. ×
0
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
2010-06 - a smalltalk about salesforce.com with java architects at YaJuG
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

2010-06 - a smalltalk about salesforce.com with java architects at YaJuG

279

Published on

An overview of the force.com and salesforce.com environment for java developper presented by iKe at YaJug, the Java User Group of Luxembourg.

An overview of the force.com and salesforce.com environment for java developper presented by iKe at YaJug, the Java User Group of Luxembourg.

Published in: Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
279
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. a smalltalk about Salesforc e with architects June 30th, 2010 Yves Leblond Leblond Yves @small_talks @small_talks
  • 2. 2010 Chatter - VMforce2009 67 900 1 500 0002008 51 800 1 100 000 force.com “sites” - GoogleApps link2007 41 000 850 000 VisualForce - force.com2006 29 800 646 000 App Exchange2005 20 500 393 0002004 13 900 227 0002003 8 700 127 0002002 5 700 76 0002001 3 500 53 000 Fastest Growing Online CRM Company2000 1 500 3 000 Salesforce CRM - the multi tenant architecture Founders launch salesforce.com in small San Francisco apartment1999 “The End of Software” revolution begins June 30th, 2010 Yves Leblond @small_talks
  • 3. Cloud computing ?June 30th, 2010 Yves Leblond @small_talks
  • 4. Cloud computing ?• everything as a service (and more) PAAS ! SAAS ! IAAS ! Cloud ! Cloud SA SaaS AG• consider IT as a facility Cloud computing expert summit provided on demand June 30th, 2010 Yves Leblond @small_talks
  • 5. The great IAAS leap forward ;-) Before IAAS After IAASadd some RAM, CPU, servers and see what happens... I have the solution : provision but had to wait for budget, some virtual machines ;-) purchase and delivery... so think twiceDoes anyone knows what this What is this virtual machine server is there for ? don’t for ? anyway, it costs ‘only’ unplug it ! 100!/month. don’t touch !. (even in big banks...) June 30th, 2010 Yves Leblond @small_talks
  • 6. The owner point of view more flexibleCheaperJune 30th, 2010 Yves Leblond @small_talks
  • 7. What may happen if wild usages (as usual?) the more systems we Virtualisation have, the more we are happy !is our new game ! The worst the software is, the most Give us more System we have work fun ! administrators That will never change ! June 30th, 2010 Yves Leblond @small_talks
  • 8. “Good practices usage” is the key to cloudcomputing implementation projects• ITSM ‘in the IAAS cloud’ : new constraints, but stay rigorous (even more)• Software design ‘in the PAAS cloud’: think scalability and cloud deployment• Learn, then use best practices, cloud application frameworks, etc...• Or... June 30th, 2010 Yves Leblond @small_talks
  • 9. Lets take the developer(and user) point of viewIAAS (may be) part of the solution. but not the solution SOFTWARE DESIGN USER SOLUTION DESIGN June 30th, 2010 Yves Leblond @small_talks
  • 10. June 30th, 2010 Yves Leblond @small_talks
  • 11. June 30th, 2010 Yves Leblond @small_talks
  • 12. Which IT components ? SalesCloud Applications SAAS ServiceCloud Custom apps Transaction/ Google Force.com PAAS AppEngineStructured data Force.com sites Servers IAAS Amazon EC2 (VMForce) Massive Amazon S3 Storage June 30th, 2010 Yves Leblond @small_talks
  • 13. so let’s go !1. force.com model2. force.com multitenant architecture3. force.com and java4. VMforce (VMWare, force.com & java) June 30th, 2010 Yves Leblond @small_talks
  • 14. 1. force.com modelJune 30th, 2010 Yves Leblond @small_talks
  • 15. June 30th, 2010 Yves Leblond @small_talks
  • 16. force.com layers• Custom Objects : your data• Native GUI and customization• Workflow, Rules, Security profiles, Dashboards, Reporting ...• Apex Classes and Triggers : processing• VisualForce : native MVC frameworkJune 30th, 2010 Yves Leblond @small_talks
  • 17. Basic Objects• User, Contact, Account, ...• Tasks, Notes, ...• Mail, templates, ...• ako of groupware layerJune 30th, 2010 Yves Leblond @small_talks
  • 18. Custom objectsJune 30th, 2010 Yves Leblond @small_talks
  • 19. Native GUI and customisationJune 30th, 2010 Yves Leblond @small_talks
  • 20. Workflows, ...June 30th, 2010 Yves Leblond @small_talks
  • 21. Apex languagetrigger blockDuplicates_tgr on Lead bulk(before insert, before update) { /* * begin by building a map which stores the (unique) list of leads * being inserted/updated, using email address as the key. */ Map<String, Lead> leadMap = new Map<String, Lead>(); for (Lead lead : System.Trigger.new) {" if (lead.Email != null) { // skip null emails " /* for inserts OR " * updates where the email address is changing " * check to see if the email is a duplicate of another in " * this batch, if unique, add this lead to the leadMap " */ " if ( System.Trigger.isInsert || " " (System.Trigger.isUpdate && "lead.Email != System.Trigger.oldMap.get(lead.Id).Email)) { """ if (leadMap.containsKey(lead.Email)) {" lead.Email.addError(Another new lead has the same email address.);" } else {" leadMap.put(lead.Email, lead);" } " } } } /* Using the lead map, make a single database query, * find all the leads in the database that have the same email address as * any of the leads being inserted/updated. */ June 30th, 2010 Yves Leblond @small_talks for (Lead lead : [select Email from Lead where Email IN :leadMap.KeySet()]) {
  • 22. Apex usage• triggers• classes (internal or web services)• batch processing• Visualforce controllers• ...June 30th, 2010 Yves Leblond @small_talks
  • 23. SOQL - SOSL• SOQL (Salesforce Object Query Language) • “select” : more or less the SQL logic for querying objects stored in DB • “insert, update, delete” : used for loaded/instantiated objects (one or many per request), not like SQL processing logic (more like a “persistence layer”).• SOSL (Salesforce Object Search Languages) • text based search (full text indexes) June 30th, 2010 Yves Leblond @small_talks
  • 24. Visual force• Salesforce MVC development modelJune 30th, 2010 Yves Leblond @small_talks
  • 25. Security and user management• by roles (company organigram)• by profile (manager, vendor, project mgr)• can be refined using complexe rules (e.g. depending of attributes values)• immediate and automatic propagation June 30th, 2010 Yves Leblond @small_talks
  • 26. Profiles, rolesJune 30th, 2010 Yves Leblond @small_talks
  • 27. Packaging• a set of custom object definitions, classes, trigger definitions,VisualForce components • “packaged” together • to be moved from on org to another• Versioning and dependancies• Installation and uninstallation (removing associated data)• Unit tests mandatory ! • 75% of code must be covered by unit tests before being packaged... June 30th, 2010 Yves Leblond @small_talks
  • 28. Sandbox• a complete copy of your company data (called your “organisation”), where you can : • deploy new packages version • deploy other company applications• and test them for real Have you ever dream of such a test environment ??? think to the efforts, human and financial ressources, to have a test environment always up to date... June 30th, 2010 Yves Leblond @small_talks
  • 29. force.com governor Governor limit : execution time, external calls per transaction, SOQL statements per transaction, ... Limit Trigger Anonymous Block, ...Total number of SOQL queries issued2 20 100Total number of records retrieved by SOQL queries 1000 10000Total number of SOSL queries issued 0 20Total number of records retrieved by a single SOSL query 0 200Total number of DML statements issued (insert, update, upsert, merge, delete,or database.emptyRecycleBin) 20 100Total number of records processed as a result of DML statements ordatabase.emptyRecycleBin 100 10000 .... June 30th, 2010 Yves Leblond @small_talks
  • 30. force.com governor The governor is there to guarantee performance and scalability fo all customers. June 30th, 2010 Yves Leblond @small_talks
  • 31. Best practicesGovernor (performance constraints), mandatory unit tests, bulk management processing and most of the salesforce constraintshelp also developer to apply best software practices even if it is sometimes frustrating ;-), if used to “Code and Go Live”. June 30th, 2010 Yves Leblond @small_talks
  • 32. 3. At the heart : the multitenant architectureJune 30th, 2010 Yves Leblond @small_talks
  • 33. “There is only one salesforcedatabase worldwide shared by all salesforces organisations and customers” And it is a giant Oracle Database, located in US, Singapore, and next in Europe data centers.June 30th, 2010 Yves Leblond @small_talks
  • 34. Multitenant architectureJune 30th, 2010 Yves Leblond @small_talks
  • 35. Physical architectureJune 30th, 2010 Yves Leblond @small_talks
  • 36. “There is only one object table” A complete heterodox design ;-)June 30th, 2010 Yves Leblond @small_talks
  • 37. TexteJune 30th, 2010 Yves Leblond @small_talks
  • 38. Query processingJune 30th, 2010 Yves Leblond @small_talks
  • 39. This is where important part of SF “know how” is (patented) : how to guarantee request response time.... Salesforce rebuild a query engine for the databases in order to manage 300.000.000 transactions every day, very little servers and an average response time of 270ms see http://trust.salesforce.com for live statsJune 30th, 2010 Yves Leblond @small_talks
  • 40. and Java ?• Internally, there is a lot of java : • APEX is precompiled in java code • it seems that VisualForce generates Java Faces code • ...• But you don’t see it ;-)June 30th, 2010 Yves Leblond @small_talks
  • 41. 3. force.com java APIJune 30th, 2010 Yves Leblond @small_talks
  • 42. One of the integration options• Flex • Amazon • Python• .net & VB • AJAX • Cocoa• Ruby • java• Google • PHP • Any WSDL consumer (APEX classes can be• Perl • Facebook declared as web services)June 30th, 2010 Yves Leblond @small_talks
  • 43. Data managementusing “Enterprise WSDL” strongly typed, based on package definitionJune 30th, 2010 Yves Leblond @small_talks
  • 44. try { binding = (SoapBindingStub) new SforceServiceLocator().getSoap();} catch (ServiceException ex1) { System.out.println(ex1.getMessage()); return;}try { lr = binding.login(userName, pwd);} catch (UnexpectedErrorFault ex2) { connect System.out.println(ex2.getExceptionMessage() + "nn" return;} catch (LoginFault ex2) { System.out.println(ex2.getExceptionMessage() + "nn"); return;} catch (RemoteException ex2) { System.out.println(ex2.getMessage() + "nn"); return;}// create a variable to hold the query resultQueryResult qr = null;// call the query saving the results in qr SOQL requesttry { qr = binding .query("select Name, numberOfEmployees, Id, Industry from Account");} catch (UnexpectedErrorFault uef) { System.out.println(uef.getExceptionMessage() + "nn"); return;} catch (Exception e) { e.printStackTrace(); System.out.println("nn"); java return;}if (qr != null) { SObject[] records = qr.getRecords(); _accounts = new Account[records.length]; // we can loop through the returned records for (int i = 0; i < records.length; i++) { // Because we asked for accounts we will convert // the SObject for each record into an Account object Account account = (Account) records[i]; _accounts[i] = account; // Now we can access any of the fields we had in the query // select clause directly from the account variable System.out.print(new Integer(i).toString() + ". "); System.out.print(account.getName() + " - "); System.out.println(account.getId()); } June 30th, 2010 Yves Leblond @small_talks
  • 45. Data management using “Partner WSDL” weakly typed, based on generic metadata infosJune 30th, 2010 Yves Leblond @small_talks
  • 46. private void querySample() { ... QueryResult qr = null; QueryOptions qo = new QueryOptions(); qo.setBatchSize(new Integer(3)); binding.setHeader(new SforceServiceLocator().getServiceName() .getNamespaceURI(), "QueryOptions", qo); SOQL request try { qr = binding.query("select FirstName, LastName from Contact"); int loopCount = 0; boolean continueLoop = true; while (continueLoop) { java, but // process the query results for (int i = 0; i < qr.getRecords().length; i++) { SObject con = qr.getRecords()[i]; laborious. String fName = ""; String lName = ""; (like in old JDBC) if (con.get_any()[0].getName().toLowerCase().equals( "firstname")) { fName = con.get_any()[0].getValue(); lName = con.get_any()[1].getValue(); } else lName = con.get_any()[0].getValue(); if (fName == null) { System.out.println("Contact " + (i + 1) + ": " + lName); } else { System.out.println("Contact " + (i + 1) + ": " + fName + " " + lName); } } // handle the loop + 1 problem by checking to see if the most // recent queryResult if (qr.isDone()) continueLoop = false; else qr = binding.queryMore(qr.getQueryLocator()); } System.out.println("nQuery succesfully executed."); getUserInput("nHit return to continue..."); } catch (ApiFault af) { System.out .println("nFailed to execute query succesfully, error message was: n" + af.getExceptionMessage()); June 30th, 2010 getUserInput("nHit return to continue..."); } catch (Exception ex) { Yves Leblond @small_talks
  • 47. Even metadata management can be done in Java...June 30th, 2010 Yves Leblond @small_talks
  • 48. ex : creation of a new kind of Custom Object typeprivate void createCustomObject(){"" CustomObject co = new CustomObject(); String name = "My Custom Object"; NB :"" co.setFullName("MyCustomObject" + "__c"); co.setDeploymentStatus(DeploymentStatus.Deployed); the Force.com IDE"" co.setDescription("Created by the Metadata API Sample"); co.setEnableActivities(true); (eclipse plugin)"" co.setLabel(name); co.setPluralLabel(co.getLabel() + "s"); use this." co.setSharingModel(SharingModel.ReadWrite);" CustomField nf = new CustomField();" nf.setType(FieldType.Text);" nf.setDescription("The custom object identifier on page layouts, " +"related lists etc");" nf.setLabel("My Custom Object");" nf.setFullName("MyCustomObject" + " __c");null)try { AsyncResult[] ars = metadatabinding.create(new CustomObject[] { co }); if (ars ==" {" " System.out.println("The object was not created successfully"); return;" }" String createdObjectId = ars[0].getId();"" String[] ids = new String[] {createdObjectId};" boolean done = false;" long waitTimeMilliSecs = ONE_SECOND;" AsyncResult[] arsStatus = null;"" …. June 30th, 2010 Yves Leblond @small_talks
  • 49. 4.VMforce ?June 30th, 2010 Yves Leblond @small_talks
  • 50. VMforce ?• VMforce : Spring applications on top of this• Custom Objects : your data• Native GUI and customization• Workflow, Rules, Security profiles, ...• Apex Classes and Triggers : processing• VisualForce : native MVC frameworkJune 30th, 2010 Yves Leblond @small_talks
  • 51. June 30th, 2010 Yves Leblond @small_talks
  • 52. • Spring : • Spring Framework • SpringSource TC server (Server® runtime, the Enterprise version of Apache Tomcat)• force.com • force.com services • force.com database • everything we talked before : including automatic scalability, high availability, auto-tuning, back up and disaster recovery....• VMware • vCloud technology: Automatic management of the Java stack that powers VMforce applications • VMware vSphere: Industry leading virtualization platform will provide the resource isolation, management, and virtualization June 30th, 2010 Yves Leblond @small_talks
  • 53. VMforceJune 30th, 2010 Yves Leblond @small_talks
  • 54. one many more things...June 30th, 2010 Yves Leblond @small_talks
  • 55. a smalltalk about Salesforc e with architects June 30th, 2010 Yves Leblond Leblond Yves @small_talks @small_talks

×