SlideShare a Scribd company logo
1 of 29
Download to read offline
Expressive
Design
(in 20 minutes)
            phillip calçado
         http://fragmental.tw
javamail usage
I want this CSV
report delivered
  as an e-mail
  attachment
1st Try
public class Mail {

	   public void sendEmailWithCsvFile(String from, String to, String subject,
	   	    	   String body, List<String> csvFileLines) {

	   	    Properties props = new Properties();
	   	    props.put(quot;mail.smtp.hostquot;, quot;localhostquot;);

	   	    Session session = Session.getDefaultInstance(props);

	   	    MimeMessage msg = new MimeMessage(session);

	   	    msg.setFrom(new InternetAddress(from));

    	    InternetAddress[] address = { new InternetAddress(to) };	   	
    	    msg.setRecipients(Message.RecipientType.TO, address);
	   	    msg.setSubject(subject);
	   	    msg.setSentDate(new Date());

	   	    MimeBodyPart part1 = new MimeBodyPart();
	   	    part1.setText(body);

	   	    MimeBodyPart part2 = new MimeBodyPart();
	   	    StringBuffer buffer = new StringBuffer();
	   	    for (String line : csvFileLines)
	   	    	    buffer.append(line + quot;nquot;);
	   	    part2.setContent(buffer.toString(), quot;text/csvquot;);
	   	    part2.setFileName(quot;file.csvquot;);

	   	    Multipart mp = new MimeMultipart();
	   	    mp.addBodyPart(part1);
	   	    mp.addBodyPart(part2);

	   	    msg.setContent(mp);

	   	    Transport.send(msg);	   }
}
Message.RecipientType
I want this CSV
report delivered   InternetAddress      Multipart
  as an e-mail
  attachment
                    MimeMessage      MimeBodyPart


                       Session        Properties
2nd Try
public class Mail {

	   public void sendEmailWithCsvFile(String from, String to, String subject,
	   	    	   String body, List<String> csvFileLines) {

	   	    Properties props = new Properties();
	   	    props.put(quot;mail.smtp.hostquot;, quot;localhostquot;);
	   	    MailService mailService = new MailService(props);
	   	    MailMessage message = mailService.newMessage();
	   	    message.setFrom(from);
	   	    message.setTo(to);
	   	    message.setSubject(subject);
	   	    message.setBody(body);

	   	    StringBuffer buffer = new StringBuffer();
	   	    for (String line : csvFileLines)
	   	    	    buffer.append(line + quot;nquot;);
	   	    Attachment csvFile = new Attachment(quot;file.csvquot;, buffer.toString());
	   	    message.attach(csvFile);

	   	    mailService.send(message);
	   }
}
I want this CSV    MailMessage   Attachment
report delivered
  as an e-mail
                   MailService   Properties
  attachment
3rd Try
public class Mail {

	   public void sendEmailWithCsvFile(String from, String to, String subject,
	   	    	   String body, List<String> csvFileLines) {

	   	    StringBuffer buffer = new StringBuffer();
	   	    for (String line : csvFileLines)
	   	    	    buffer.append(line + quot;nquot;);
	   	
	   	    Properties props = new Properties();
	   	    props.put(quot;mail.smtp.hostquot;, quot;localhostquot;);
	   	
	   	    MailService mailService = new MailService(props);
	   	    mailService.newMessage()
	   	    	    .from(from)
	   	    	    .to(to)
	   	    	    .subject(subject)
	   	    	    .body(body)
	   	    	    .attachTextFile(quot;file3.csvquot;, buffer.toString())
	   	    	    .send();
	   }
}
send_email do
    to 'pcalcado@gmail.com'
    from 'bemaia@fragmental.tw'
    subject 'Testing via Ruby'

      body %{
          Hi,
          Please do not forget the milk.
          Bye!
      }

      attachment('file4.csv') << lines
end
I want this CSV      E-mail
report delivered
  as an e-mail
                   Attachment
  attachment
what just
happened?
Noise   Reduction
Noise
                   the difference between


I want this CSV                               E-mail
report delivered
  as an e-mail
                                            Attachment
  attachment
Noise
                   the difference between


I want this CSV                               E-mail
report delivered
    This
  as an e-mail
                                            Attachment
  attachment
Noise
                   the difference between


I want this CSV                             E-mail
report delivered
    This                                That
  as an e-mail
                                        Attachment
  attachment
Noise
           the difference between

Business      Analysis      Design                                       Implementation

                                                                            public class Something{
                            Class Name                      Class Name
                         Attribute                       Attribute
                         Attribute                       Attribute
                                                                                private String name;
                         Operation                       Operation
                         Operation                       Operation


                                                                                 public boolean doS(){
                                                                                 }
                                            Class Name
                                         Attribute

                                                                            }
                                         Attribute
                                         Operation
                                         Operation




This                                                                       That
the goal
I want this CSV
report delivered
  as an e-mail
  attachment
I want this CSV
report delivered
  as an e-mail
         E-mail


  attachment
I want this CSV
report delivered
  as an e-mailE-mail


  attachment
     Attachment
the techniques
Noise




Idiomatic”
   Java



        Domain-Driven
            Design
                        Internal DSL

                                  External DSL?
“Idiomatic”: Focus on how to use
              technical tools to solve the
              problem in an efficient way.

              Domain-Driven: Language is only a
              tool to model the domain.


              Internal DSL: Language is only an
:internal {
              extensible tool to model the
    DSL
              domain.
}

              External DSL: Language is created
              based on the domain.
“Idiomatic”: TFocus on how to use
                              DO: a
                            O             e
                               e d r n am
              technical toolsr thato solve the
                            Ne te
                              be t     t
                                fo
              problem in an efficient way.

              Domain-Driven: Language is only a
              tool to model the domain.


              Internal DSL: Language is only an
:internal {
              extensible tool to model the
    DSL
              domain.
}

              External DSL: Language is created
              based on the domain.
Thanks




http://fragmental.tw
pics
•   http://www.flickr.com/photos/bitzi/293673587/


•   http://www.flickr.com/photos/sage/2143086954/

•   http://www.flickr.com/photos/brianmitchell/2113553867/


•   http://www.flickr.com/photos/kamaski/186266747/

•   http://www.flickr.com/photos/tosawyer/43691981/


•   http://www.flickr.com/photos/helderfontenele/2134684620/

•   http://www.flickr.com/photos/sotto1/808195510/

More Related Content

What's hot

Numerical Data And Expression
Numerical Data And ExpressionNumerical Data And Expression
Numerical Data And Expression
PRN USM
 
Coveney pig lecture
Coveney pig lectureCoveney pig lecture
Coveney pig lecture
Seven Nguyen
 

What's hot (11)

Intro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part II
Intro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part IIIntro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part II
Intro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part II
 
Numerical Data And Expression
Numerical Data And ExpressionNumerical Data And Expression
Numerical Data And Expression
 
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To  Classes, Objects, & StringsIntro To C++ - Class 05 - Introduction To  Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
 
Kotlin- Basic to Advance
Kotlin- Basic to Advance Kotlin- Basic to Advance
Kotlin- Basic to Advance
 
Domain specific languages and Scala
Domain specific languages and ScalaDomain specific languages and Scala
Domain specific languages and Scala
 
Lecture Notes
Lecture NotesLecture Notes
Lecture Notes
 
01 Java Language And OOP PART I
01 Java Language And OOP PART I01 Java Language And OOP PART I
01 Java Language And OOP PART I
 
Beamer tutorial
Beamer tutorialBeamer tutorial
Beamer tutorial
 
Coveney pig lecture
Coveney pig lectureCoveney pig lecture
Coveney pig lecture
 
Europeana and RDF data validation
Europeana and RDF data validationEuropeana and RDF data validation
Europeana and RDF data validation
 
Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programming
 

Similar to Expressive Design (in 20 minutes)

Overview Of .Net 4.0 Sanjay Vyas
Overview Of .Net 4.0   Sanjay VyasOverview Of .Net 4.0   Sanjay Vyas
Overview Of .Net 4.0 Sanjay Vyas
rsnarayanan
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
intelliyole
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overview
bwullems
 
Tech Days Paris Intoduction F# and Collective Intelligence
Tech Days Paris Intoduction F# and Collective IntelligenceTech Days Paris Intoduction F# and Collective Intelligence
Tech Days Paris Intoduction F# and Collective Intelligence
Robert Pickering
 

Similar to Expressive Design (in 20 minutes) (20)

Xbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for JavaXbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for Java
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
 
Accessing loosely structured data from F# and C#
Accessing loosely structured data from F# and C#Accessing loosely structured data from F# and C#
Accessing loosely structured data from F# and C#
 
Linguistic Abstraction for the Web
Linguistic Abstraction for the WebLinguistic Abstraction for the Web
Linguistic Abstraction for the Web
 
Overview Of .Net 4.0 Sanjay Vyas
Overview Of .Net 4.0   Sanjay VyasOverview Of .Net 4.0   Sanjay Vyas
Overview Of .Net 4.0 Sanjay Vyas
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
 
Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overview
 
Model-Driven Software Development - Language Workbenches & Syntax Definition
Model-Driven Software Development - Language Workbenches & Syntax DefinitionModel-Driven Software Development - Language Workbenches & Syntax Definition
Model-Driven Software Development - Language Workbenches & Syntax Definition
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDT
 
iOS Application Development
iOS Application DevelopmentiOS Application Development
iOS Application Development
 
Angular Schematics
Angular SchematicsAngular Schematics
Angular Schematics
 
MuleSoft DataWeave data transformation language
MuleSoft DataWeave data transformation languageMuleSoft DataWeave data transformation language
MuleSoft DataWeave data transformation language
 
Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous Merb
 
Tech Days Paris Intoduction F# and Collective Intelligence
Tech Days Paris Intoduction F# and Collective IntelligenceTech Days Paris Intoduction F# and Collective Intelligence
Tech Days Paris Intoduction F# and Collective Intelligence
 

More from Phil Calçado

the afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowththe afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowth
Phil Calçado
 
don't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leaderdon't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leader
Phil Calçado
 
From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019
Phil Calçado
 
The Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to ServerlessThe Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to Serverless
Phil Calçado
 
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Phil Calçado
 
An example of Future composition in a real app
An example of Future composition in a real appAn example of Future composition in a real app
An example of Future composition in a real app
Phil Calçado
 
Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at Work
Phil Calçado
 
Structuring apps in Scala
Structuring apps in ScalaStructuring apps in Scala
Structuring apps in Scala
Phil Calçado
 

More from Phil Calçado (20)

the afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowththe afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowth
 
don't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leaderdon't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leader
 
The Economics of Microservices (redux)
The Economics of Microservices (redux)The Economics of Microservices (redux)
The Economics of Microservices (redux)
 
From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019
 
The Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to ServerlessThe Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to Serverless
 
Ten Years of Failing Microservices
Ten Years of Failing MicroservicesTen Years of Failing Microservices
Ten Years of Failing Microservices
 
The Next Generation of Microservices
The Next Generation of MicroservicesThe Next Generation of Microservices
The Next Generation of Microservices
 
The Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 BrisbaneThe Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 Brisbane
 
The Economics of Microservices (2017 CraftConf)
The Economics of Microservices  (2017 CraftConf)The Economics of Microservices  (2017 CraftConf)
The Economics of Microservices (2017 CraftConf)
 
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
 
Finagle @ SoundCloud
Finagle @ SoundCloudFinagle @ SoundCloud
Finagle @ SoundCloud
 
A Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing OrganisationsA Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing Organisations
 
Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
 
Rhein-Main Scala Enthusiasts — Your microservice as a Function
Rhein-Main Scala Enthusiasts — Your microservice as a FunctionRhein-Main Scala Enthusiasts — Your microservice as a Function
Rhein-Main Scala Enthusiasts — Your microservice as a Function
 
ScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a FunctionScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a Function
 
Finagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloudFinagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloud
 
An example of Future composition in a real app
An example of Future composition in a real appAn example of Future composition in a real app
An example of Future composition in a real app
 
APIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog FoodAPIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog Food
 
Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at Work
 
Structuring apps in Scala
Structuring apps in ScalaStructuring apps in Scala
Structuring apps in Scala
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Expressive Design (in 20 minutes)

  • 1. Expressive Design (in 20 minutes) phillip calçado http://fragmental.tw
  • 3. I want this CSV report delivered as an e-mail attachment
  • 5. public class Mail { public void sendEmailWithCsvFile(String from, String to, String subject, String body, List<String> csvFileLines) { Properties props = new Properties(); props.put(quot;mail.smtp.hostquot;, quot;localhostquot;); Session session = Session.getDefaultInstance(props); MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(from)); InternetAddress[] address = { new InternetAddress(to) }; msg.setRecipients(Message.RecipientType.TO, address); msg.setSubject(subject); msg.setSentDate(new Date()); MimeBodyPart part1 = new MimeBodyPart(); part1.setText(body); MimeBodyPart part2 = new MimeBodyPart(); StringBuffer buffer = new StringBuffer(); for (String line : csvFileLines) buffer.append(line + quot;nquot;); part2.setContent(buffer.toString(), quot;text/csvquot;); part2.setFileName(quot;file.csvquot;); Multipart mp = new MimeMultipart(); mp.addBodyPart(part1); mp.addBodyPart(part2); msg.setContent(mp); Transport.send(msg); } }
  • 6. Message.RecipientType I want this CSV report delivered InternetAddress Multipart as an e-mail attachment MimeMessage MimeBodyPart Session Properties
  • 8. public class Mail { public void sendEmailWithCsvFile(String from, String to, String subject, String body, List<String> csvFileLines) { Properties props = new Properties(); props.put(quot;mail.smtp.hostquot;, quot;localhostquot;); MailService mailService = new MailService(props); MailMessage message = mailService.newMessage(); message.setFrom(from); message.setTo(to); message.setSubject(subject); message.setBody(body); StringBuffer buffer = new StringBuffer(); for (String line : csvFileLines) buffer.append(line + quot;nquot;); Attachment csvFile = new Attachment(quot;file.csvquot;, buffer.toString()); message.attach(csvFile); mailService.send(message); } }
  • 9. I want this CSV MailMessage Attachment report delivered as an e-mail MailService Properties attachment
  • 11. public class Mail { public void sendEmailWithCsvFile(String from, String to, String subject, String body, List<String> csvFileLines) { StringBuffer buffer = new StringBuffer(); for (String line : csvFileLines) buffer.append(line + quot;nquot;); Properties props = new Properties(); props.put(quot;mail.smtp.hostquot;, quot;localhostquot;); MailService mailService = new MailService(props); mailService.newMessage() .from(from) .to(to) .subject(subject) .body(body) .attachTextFile(quot;file3.csvquot;, buffer.toString()) .send(); } }
  • 12. send_email do to 'pcalcado@gmail.com' from 'bemaia@fragmental.tw' subject 'Testing via Ruby' body %{ Hi, Please do not forget the milk. Bye! } attachment('file4.csv') << lines end
  • 13. I want this CSV E-mail report delivered as an e-mail Attachment attachment
  • 15. Noise Reduction
  • 16. Noise the difference between I want this CSV E-mail report delivered as an e-mail Attachment attachment
  • 17. Noise the difference between I want this CSV E-mail report delivered This as an e-mail Attachment attachment
  • 18. Noise the difference between I want this CSV E-mail report delivered This That as an e-mail Attachment attachment
  • 19. Noise the difference between Business Analysis Design Implementation public class Something{ Class Name Class Name Attribute Attribute Attribute Attribute private String name; Operation Operation Operation Operation public boolean doS(){ } Class Name Attribute } Attribute Operation Operation This That
  • 21. I want this CSV report delivered as an e-mail attachment
  • 22. I want this CSV report delivered as an e-mail E-mail attachment
  • 23. I want this CSV report delivered as an e-mailE-mail attachment Attachment
  • 25. Noise Idiomatic” Java Domain-Driven Design Internal DSL External DSL?
  • 26. “Idiomatic”: Focus on how to use technical tools to solve the problem in an efficient way. Domain-Driven: Language is only a tool to model the domain. Internal DSL: Language is only an :internal { extensible tool to model the DSL domain. } External DSL: Language is created based on the domain.
  • 27. “Idiomatic”: TFocus on how to use DO: a O e e d r n am technical toolsr thato solve the Ne te be t t fo problem in an efficient way. Domain-Driven: Language is only a tool to model the domain. Internal DSL: Language is only an :internal { extensible tool to model the DSL domain. } External DSL: Language is created based on the domain.
  • 29. pics • http://www.flickr.com/photos/bitzi/293673587/ • http://www.flickr.com/photos/sage/2143086954/ • http://www.flickr.com/photos/brianmitchell/2113553867/ • http://www.flickr.com/photos/kamaski/186266747/ • http://www.flickr.com/photos/tosawyer/43691981/ • http://www.flickr.com/photos/helderfontenele/2134684620/ • http://www.flickr.com/photos/sotto1/808195510/