Slide 1

Slide 1 text

Breaking The Monotony @sai_venkat & @harikrishnan83

Slide 2

Slide 2 text

Or

Slide 3

Slide 3 text

Theme The Agility we seek is from the code we write and systems we build and not just from processes and practices we follow.

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Why this talk? ● As Craftsmen we are on look out for right tool for the job and sharing our experiences with you. ● This talk is based on the experiences we have on our day to day projects – The choice we make when we build the application can bring us agility. ● We have chosen to concentrate on these areas because in any decent sized (Enterprise :P) project these problems are common.

Slide 6

Slide 6 text

Introspection

Slide 7

Slide 7 text

Modeling time ● Aim – To build the world's largest resume builder. ● We choose you as the architect (or funky name – Master Craftsman) to create a model of a profile builder. ● Tell us what you need (tools, frameworks) and your model. ● Catch – We don't want to restrict the resumes coming in from public in any way. We want the users to give as much information about them as possible

Slide 8

Slide 8 text

Person_PK LastName 1 clouseau Resume _PK Person _FK Title Summary 2 1 Inspector turned Developer Developer with instincts of an inspector Resume_FK Skill_FK 2 1 2 2 2 3 Skill_PK Name Description 1 Java Statically typed language 2 Clojure Lisp like language 3 Haskel Functional language S E L E C T * F R O M P e rso n p , R e su m e r, S k ill s, R e su m e _ S k ill rs W H E R E p .P e rso n _ P K = r.P e rso n _ F K A N D r.Re su m e _P K = rs.R e su m e _ F K A N D s.S k ill_ P K = rs.S k ill_ F K A N D s .N a m e in ( “J a v a ”, “C lo ju re ”)

Slide 9

Slide 9 text

Same Data Modeled as Documents { Name: “Mr Magoo”, title: “Funny developer”, Skills: [“Ruby”, “Self”, “Clojure”], Email-id: “magoo@looneytoons.com”, Experience: 4 } { Name: “Closseau”, title: “Inspector turned developer”, Skills: [“Ruby”, “Haskell”, “C#”], Telephone_Numbers: [9611805466], Experience: 5 } Querying the Data: Map function: function(doc) { if (contains(doc.skills, [“java”, “clojure”])) { emit(null, doc); } }

Slide 10

Slide 10 text

A Case for Non Relational Databases ● Schema less Data helps us to evolve the model over the course of application development and maintenance (Ex. FriendFeed, github, Sourceforge) ● Scaling out is easy in nosql databases. Throw in more commodity machine. ● You may not always need atomic consistency (Dirty interface of mnesia) ● Most nosql Databases are simpler than conventional RDBMS, hence more robust and lightweight ● SQL Engines are only a convenience If they are not helping don't have to use them (Waffle on Mysql Datastore)

Slide 11

Slide 11 text

Polyglot & PolyParadigm Programming ● Today's Applications Need to ● Must scale ● Must be resilient and secure ● Must evolve for future ● Work with large volumes of data and users.

Slide 12

Slide 12 text

Hope you don't have someone like this in your team - I work only with Java.....

Slide 13

Slide 13 text

Polyglot & PolyParadigm Programming ● Are there any advantages to writing an entire application in one language or one stack (Microsoft shop or Java shop anyone)? ● Is one language best for all domains? ● Are we harnessing the power we have in our hardware? ● Languages have their boundaries – Imperative vs Functional, Static vs Dynamic, Procedural vs Object Oriented ● Advantages are mostly relative and context sensitive. ● Examples: Flightcaster, Facebook Chat, github - BERT, Runa – Swarmiji, Twitter ● No Language Wars please :)

Slide 14

Slide 14 text

In Erlang -module (fact). -export ([fact/1]). fact(0) -> 1; fact(N) -> N * fact(N -1). Tail Recursion Optimized -module (fact). -export ([fact/1]). fact(N) -> fact(N, 1). fact(0, A) -> A; fact(N, A) -> fact(N -1, N * A). In Java public int fact(int value) { if (value == 0) { return 0; } else { return value * fact(value - 1); } }

Slide 15

Slide 15 text

Polyglotism in Testing package org.openqa.selenium.example; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.htmlunit.HtmlUnitDriver; public class Example { public static void main(String[] args) { WebDriver driver = new HtmlUnitDriver(); driver.get("http://www.google.com"); WebElement element = driver.findElement(By.name("q")); element.sendKeys("Cheese!"); element.submit(); System.out.println("Page title is: " + driver.getTitle()); } } require “watir” browser = Watir::Browser.new(:firefox) browser.goto “http://www.google.com” browser.text_field(:name, “q”).set “Cheese” browser.button(:name, “btnG”).click puts “Page title is #{browser.title}” We would use Java or C# to write functional tests as our application code is in that language

Slide 16

Slide 16 text

Polyglotism in Testing Feature: Proposal notification In order to reduce time spent on emailing Administrators should be able to mail all proposals owners depending on status Scenario: Email accepted proposal Given hari@gmail.com proposed 'Breaking the Monotony' And the 'Breaking the Monotony' proposal is approved When I send mass proposal email Then hari@gmail.com should get email """ Hi hari@gmail.com Congratulations, 'Breaking the Monotony' was accepted. See you at 'Agile India 2010'! """ Using Cucumber + Jruby or Groovy for acceptance testing of services and API interfaces in Java.

Slide 17

Slide 17 text

Polyglotism in Testing Feature: Proposal notification In order to reduce time spent on emailing Administrators should be able to mail all proposals owners depending on status Scenario: Email accepted proposal Given hari@gmail.com proposed 'Breaking the Monotony' And the 'Breaking the Monotony' proposal is approved When I send mass proposal email Then hari@gmail.com should get email """ Hi hari@gmail.com Congratulations, 'Breaking the Monotony' was accepted. See you at 'Agile India 2010'! """ Using Cucumber + Jruby or Groovy for acceptance testing of services and API interfaces in Java.

Slide 18

Slide 18 text

Build and Deployment ● Build script or Build code? ● 9000 lines of XML Code and still no test? ● We really need a first class language for flexibility ● Programming in XML doesn't make sense ● Pure declarative model solves some problems but reduces flexibility ● Testing is much simpler with a real language ● Use Ruby or Groovy for build (Example: FubuMVC in Rake) and Capistrano for deployment. ● Continuous Deployment. ● Cloud for deployment.

Slide 19

Slide 19 text

The path less traveled

Slide 20

Slide 20 text

Thank you for listening to us. Sai Venkatakrishnan Twitter - http://twitter.com/sai_venkat Github - http://github.com/saivenkat Blog - http://developer-in-test.blogspot.com Harikrishnan Twitter - http://twitter.com/harikrishnan83 Github - http://github.com/harikrishnan83 Blog - http://harikrishnan83.wordpress.com