SlideShare a Scribd company logo
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

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
Blue Elephant Consulting
 
Numerical Data And Expression
Numerical Data And ExpressionNumerical Data And Expression
Numerical Data And Expression
PRN USM
 
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
Blue Elephant Consulting
 
Kotlin- Basic to Advance
Kotlin- Basic to Advance Kotlin- Basic to Advance
Kotlin- Basic to Advance
Coder Tech
 
Domain specific languages and Scala
Domain specific languages and ScalaDomain specific languages and Scala
Domain specific languages and Scala
Filip Krikava
 
Lecture Notes
Lecture NotesLecture Notes
Lecture Notes
Dwight Sabio
 
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
Hari Christian
 
Coveney pig lecture
Coveney pig lectureCoveney pig lecture
Coveney pig lectureSeven Nguyen
 
Europeana and RDF data validation
Europeana and RDF data validationEuropeana and RDF data validation
Europeana and RDF data validation
Antoine Isaac
 
Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programming
Neelesh Shukla
 

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)

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
meysholdt
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
Mahmoud Ouf
 
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#
Tomas Petricek
 
Linguistic Abstraction for the Web
Linguistic Abstraction for the WebLinguistic Abstraction for the Web
Linguistic Abstraction for the Web
Eelco Visser
 
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 Vyasrsnarayanan
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
Mahmoud Ouf
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
salonityagi
 
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)
ukdpe
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLsintelliyole
 
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 Overviewbwullems
 
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
Eelco Visser
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDT
Bastian Feder
 
Angular Schematics
Angular SchematicsAngular Schematics
Angular Schematics
Christoffer Noring
 
MuleSoft DataWeave data transformation language
MuleSoft DataWeave data transformation languageMuleSoft DataWeave data transformation language
MuleSoft DataWeave data transformation language
fganora
 
Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous Merb
Matt Todd
 
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 IntelligenceRobert 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
 
The Economics of Microservices (redux)
The Economics of Microservices (redux)The Economics of Microservices (redux)
The Economics of Microservices (redux)
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
 
Ten Years of Failing Microservices
Ten Years of Failing MicroservicesTen Years of Failing Microservices
Ten Years of Failing Microservices
Phil Calçado
 
The Next Generation of Microservices
The Next Generation of MicroservicesThe Next Generation of Microservices
The Next Generation of Microservices
Phil Calçado
 
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
Phil Calçado
 
The Economics of Microservices (2017 CraftConf)
The Economics of Microservices  (2017 CraftConf)The Economics of Microservices  (2017 CraftConf)
The Economics of Microservices (2017 CraftConf)
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
 
Finagle @ SoundCloud
Finagle @ SoundCloudFinagle @ SoundCloud
Finagle @ SoundCloud
Phil Calçado
 
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
Phil Calçado
 
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
Phil Calçado
 
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
Phil Calçado
 
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
Phil Calçado
 
Finagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloudFinagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloud
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 appPhil Calçado
 
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
Phil Calçado
 
Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at WorkPhil Calçado
 
Structuring apps in Scala
Structuring apps in ScalaStructuring apps in Scala
Structuring apps in ScalaPhil 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

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 

Recently uploaded (20)

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 

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/