1 / 49

Farvel til applikasjonsserveren

Farvel til applikasjonsserveren. Fra kompleksitet til kontroll. Agenda. Fra kompleksitet til kontroll: Prosess og automasjon En kort historie om Java EE Demonstrasjon av prosess og verktøy Erfaringer Hvordan kommer man hit?. Om foredragsholderen. Johannes Brodwall Sjefsbråkmaker på BBS

Download Presentation

Farvel til applikasjonsserveren

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Farvel til applikasjonsserveren Fra kompleksitet til kontroll

  2. Agenda • Fra kompleksitet til kontroll: Prosess og automasjon • En kort historie om Java EE • Demonstrasjon av prosess og verktøy • Erfaringer • Hvordan kommer man hit?

  3. Om foredragsholderen • Johannes Brodwall • Sjefsbråkmaker på BBS • Aktiv i miljøet rundt smidige metoder i Oslo • Med å arrangere ROOTS 2008 • I kveld: Kode dojo!

  4. Hva lovet Java EE? • Skalering • Manageability (deployment) • Robusthet (failover) • Sikkerhet (yeah! Right!) • Programmeringsmodell • Component Transaction Monitor • 2-fase commit

  5. Hva leverte Java EE • Kompleksitet • Utestbar kode • Vanskelig å debugge • Ikke-automatisebare rutiner

  6. Alternativet

  7. Continuous Deployment

  8. Prosessen: • Skriv en test • Implementer koden for å få den til å virke • Sjekk inn • Byggserver bygger automatisk • Testserver deployer automatisk • Iterasjonsslutt: Lever i preproduksjon • Leveranseslutt: Lever det samme i produksjon

  9. DEMO

  10. Preproduction environment

  11. Symbolic link

  12. port=9090 • shutdown_port=9190 • datasource.url=jdbc:mysql://localhost/nocontainer_dev • datasource.username=johannes • datasource.password=johannes

  13. publicvoid testDeleteCategory() throws Exception { // Insert test data Category category = new Category(uniqueName()); Serializable key = getRepo().insert(category); getRepo().writeChanges(); // Ensure that data is displayed in index beginAt("categories/list.html"); assertTextPresent("Showing all categories"); assertLinkPresentWithText(category.getName()); // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there assertLinkNotPresentWithText(category.getName()); }

  14. publicvoid testDeleteCategory() throws Exception { // Insert test data Category category = new Category(uniqueName()); Serializable key = getRepo().insert(category); getRepo().writeChanges(); // Ensure that data is displayed in index beginAt("categories/list.html"); assertTextPresent("Showing all categories"); assertLinkPresentWithText(category.getName()); // Delete it // Ensure that the category is no longer there assertLinkNotPresentWithText(category.getName()); }

  15. publicvoid testDeleteCategory() throws Exception { // Insert test data // Ensure that data is displayed in index // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there }

  16. publicvoid testDeleteCategory() throws Exception { // Insert test data // Ensure that data is displayed in index // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there }

  17. <html> <body> <h2 id="name">${category.name}</h2> #showErrors("category") <form method="POST"> <p><strong>Parent:</strong> #selectForObject("category.parent" $allCategories)</p> <p>Description: #springFormInput("category.description" "") #springShowErrors("<br>" "")</p> <p>Type: #selectForEnum("category.type" $categoryTypes)</p> <input type="submit" value="Submit" /> </form> <p><a href="list.html">List all</a></p> </body> </html>

  18. <html> <body> <h2 id="name">${category.name}</h2> #showErrors("category") <form method="POST"> <p><strong>Parent:</strong> #selectForObject("category.parent" $allCategories)</p> <p>Description: #springFormInput("category.description" "") #springShowErrors("<br>" "")</p> <p>Type: #selectForEnum("category.type" $categoryTypes)</p> <input type="submit" value="Submit" /> </form> <form method="POST"> <input type="submit" name="delete" value="Delete" /> </form> <p><a href="list.html">List all</a></p> </body> </html>

  19. publicvoid testDeleteCategory() throws Exception { // Insert test data // Ensure that data is displayed in index // Delete it beginAt("categories/edit.html?id=" + key); submit("delete"); // Ensure that after delete, we go to index assertTextPresent("Showing all categories"); // Ensure that the category is no longer there }

  20. protected ModelAndView onSubmit( HttpServletRequest req, HttpServletResponse resp, Object command, BindException errors) { // DEBUG BREAKPOINT Category category = (Category)command; if (category.getId() == null) { Serializable key = repository.insert(category); returnnew ModelAndView(new RedirectView("show.html?id=" + key)); } repository.update(category); // Redirect on post - go back to the same page returnnew ModelAndView(new RedirectView(req.getRequestURI() + "?" + req.getQueryString())); }

  21. protected ModelAndView onSubmit( HttpServletRequest req, HttpServletResponse resp, Object command, BindException errors) { Category category = (Category)command; if (category.getId() == null) { Serializable key = repository.insert(category); returnnew ModelAndView(new RedirectView("show.html?id=" + key)); } if (req.getParameter("delete") != null) { repository.delete(Category.class, category.getId()); return new ModelAndView(new RedirectView("list.html")); } repository.update(category); // Redirect on post - go back to the same page returnnew ModelAndView(new RedirectView(req.getRequestURI() + "?" + req.getQueryString())); }

  22. Continuous integration

  23. Continuous Deployment

  24. Mon Sep 10 18:37:02 EDT 2007: Not upgraded, skipping restart • Mon Sep 10 18:38:13 EDT 2007: Installed new version • Stopping • Starting • Testing connection (user=johannes, url=jdbc:mysql://localhost/nocontainer_dev). • .. • OK! • Deploy 'nocontainer' from /home/nocontainer/test/nocontainer-app/curr/repo/com/b • rodwall/nocontainer/nocontainer-web/1.1-SNAPSHOT/nocontainer-web-1.1-SNAPSHOT.wa • r • Server started on http://localhost:9090 in 12.547s • Mon Sep 10 18:39:02 EDT 2007: Not upgraded, skipping restart

  25. Forlat Java EE: Få kontroll • Enhetstester • Debugging • Automatisering • Enkel arkitektur • Forståelse • Gjenkjellelse • Kontroll

  26. Problemer vi hadde • Skalering • Feiltoleranse • Sesjoner • 2PC • Administrasjon av et sett med noder • Open source anskaffelse

  27. Open Source in the Enterprise(For Dummies) • Lisens: BSD, MIT, APL • Support • Robusthet • Test ytelse og krasj • Sikkerhet (sabotasje eller hull) • Bla, bla, bla • Utbredelse

  28. Jetty: 221k

  29. Lettvektscontainer: Steg for steg • Maven 2 bygg • WAR-filer • XA, EJB, sesjoner • ZIP • Assembler, appassembly, Jetty • Install script (appassembly problemstillinger) • Continuous Integration

More Related