際際滷

際際滷Share a Scribd company logo
FileMaker Developer Conference 2010

Session COR010
Small Things | Loosely Joined

Lessons Learned to Improve Quality,
Reuse Code, and Program Efficiently)

                Dr. Don Levan
           Vanguard Custom Software
Who am I?

   President, Vanguard Custom Software
   FileMaker 7, 8, 9, 10 Certified Developer
   Licensed Clinical Psychologist
   Former Photojournalist
   Founder of the Craft of FileMaker Seminar Series




                                                    2
Please See the handout (on the CD):

vanguardcs.net/devcon
You will find:
Summary of the
problem
Key points
References
Information about the
Craft of FileMaker
Seminar Series
A Story about Craft.
Programming is hard.
Small Things | Loosely Joined
Small Things | Loosely Joined
Small Things | Loosely Joined
Small Things | Loosely Joined


Fail Loudly
Small Things | Loosely Joined


Fail Loudly


Fold Knowledge into Data
Case Study: Tekserves Payment Routines
(With Technical Debt)
Small Things | Loosely Joined
Small Things:


Are compact, transparent, and do one thing well.
Small Things:


Are compact, transparent, and do one thing well.
Small Things:


Are compact, transparent, and do one thing well.
DECREASING TRANSPARENCY: BY NESTING IFS
INCREASING TRANSPARENCY: BY REFACTORING
DECREASING TRANSPARENCY: BY EXITING LATE
INCREASING TRANSPARENCY: BY REFACTORING
INCREASING TRANSPARENCY: BY NAMING WELL


Field Names:

   Lowercase and underscore.

   No punctuation other than underscore. No Periods.
   No spaces.

   Boolean: Use a form of the verb to be or to have,
   such as is_customer or has_children.

   Example: first_name

Tekserve FileMaker & MySQL Conventions (2009)
INCREASING TRANSPARENCY: BY NAMING WELL


Variable Names:

   Use a name that clearly communicates intent.

   Follow the convention for field names.

   Example: $report_type




Tekserve FileMaker & MySQL Conventions (2009)
INCREASING TRANSPARENCY: BY NAMING WELL


Script Names:

   Name scripts to describe their purpose.

   Use active voice.

   Add a parenthesis to indicate any parameters.

   Example: Process payment ( entry; type; action)



Tekserve FileMaker & MySQL Conventions (2009)
SMALL THINGS: DO ONE THING WELL


The Unix Pipe: $ program_1 | program_2 | program_3
SMALL THINGS: DO ONE THING WELL


The Unix Pipe: $ history | grep ssh -p
Loosely Joined programs:



Keep it dry, shy,
and tell the other
guy.
Andy Hunt and Dave Thomas, IEEE Software 2000
LOOSELY JOINED PROGRAMS:


Do not repeat themselves (Dry).
Keep their variables as local as possible (Shy).
Break complex scripts into disconnected layers.
Pass in the data (Tell the other guy).
Expect the output of any script to be used by another.
LOOSELY JOINED PROGRAMS: UNIX PIPES


All Unix programs have multiple streams of information:

   Standard Input

   Standard Output

   Standard Error

The pipe connects the Standard Output of one program
to the Standard input of another.
LOOSELY JOINED PROGRAMS: FILEMAKER PIPES


  Unix                     FileMaker

  Standard Input           Get (ScriptParameter)

  Standard Output          Get (ScriptResult)

  Standard Error           Get (ScriptResult)
LOOSELY JOINED PROGRAMS: FILEMAKER PIPES


      Main Script ( param_1; param_2)

              Set up variables

                                          Sub-Script ( param_1 )
      Perform Script (pass parameters)
                                           Return error & output

      Set Variables to error and output
                                          Sub-Script ( param_1 )
      Perform Script (pass parameters)
                                           Return error & output

      Set Variables to error and output

                 Exit Script
           (Return error & output)
Small Things | Loosely Joined


Case Study: Tekserves Payment Routines
(Re-factored)
Small Things | Loosely Joined
Small Things | Loosely Joined


Fail Loudly
Fail Loudly, and as soon as possible.
or,
Dead scripts tell no
lies.

The Pragmatic Programmer, From Journeyman to Master
Suppressing Errors
Capturing Errors
Dealing with Errors
Returning Errors
Logging Errors
Logging Errors
Logging Errors
Logging Errors
Small Things | Loosely Joined


Fail Loudly
Small Things | Loosely Joined


Fail Loudly


Fold Knowledge into Data
Fold Knowledge into Data
so program logic can be stupid and robust.
FOLD KNOWLEDGE INTO DATA


Differentiate between data and program logic.

Separate the data out into script parameters, custom
functions, and table records.

Use SetFieldByname, Evaluate, and other functions to
simplify script logic.
Fold Knowledge into Data
Case Study: Creating child portal records.
Fold Knowledge into Data
Case Study: Creating flexible reports
Fold Knowledge into Data
Case Study: Synchronizing FileMaker and MySQL
Small Things | Loosely Joined


Fail Loudly


Fold Knowledge into Data
Small Things | Loosely Joined


Fail Loudly


Fold Knowledge into Data
Small Things | Loosely Joined


Fail Loudly


Fold Knowledge into Data
The only way to write complex software that wont
 fall on its face is to hold its global complexity down 

build it out of simple parts connected by well-defined
interfaces, so that most problems are local and you
can have some hope of upgrading a part without
breaking the whole.




The art of Unix Programming (p. 14)
FileMaker Developer Conference 2010


               Web Update Page
 www.filemaker.com/devcon/speaker_updates

    (This is also listed in your conference binder)

           This session WILL / WILL NOT
                   have updates.
Thank You!
Please remember to fill out your
evaluation at: www.filemaker.com/
        devcon/evaluations

More Related Content

Similar to Small Things | Loosely Joined (20)

PDF
FileMaker Scripting Best Practices
DB Services
PDF
Introduction to programming by MUFIX Commnity
mazenet
PDF
Introduction To Programming (2009 2010)
SiliconExpert Technologies
PDF
Old Is the New New
Kevlin Henney
PPTX
School management system
Soumya Behera
PPTX
Design Like a Pro: Scripting Best Practices
Inductive Automation
PPT
Introduction To Programming
cwarren
DOCX
Unix commands
saywhatyousee
PDF
Guidelines to clean coding
Janak Porwal
PPT
Functionality testing techniqu
gaoliang641
PDF
20180324 leveraging unix tools
David Horvath
PPT
Qtp training session V
Aisha Mazhar
PPTX
Design Like a Pro: Scripting Best Practices
Inductive Automation
KEY
Maintaining Code
Kelly Bauer
PPT
Tec314
John Art
PPT
The Easytrieve Presention by Srinimf
Srinimf-際際滷s
DOCX
CHAPTER 1油Creating a ProgramOBJECTIVES揃 Analyze some of the i.docx
walterl4
PPTX
C STANDARDS (C17).pptx
SKUP1
PPTX
C STANDARDS (C17) (1).pptx
SKUP ACADEMY
PPTX
C STANDARDS (C17) (1).pptx
SKUP ACADEMY
FileMaker Scripting Best Practices
DB Services
Introduction to programming by MUFIX Commnity
mazenet
Introduction To Programming (2009 2010)
SiliconExpert Technologies
Old Is the New New
Kevlin Henney
School management system
Soumya Behera
Design Like a Pro: Scripting Best Practices
Inductive Automation
Introduction To Programming
cwarren
Unix commands
saywhatyousee
Guidelines to clean coding
Janak Porwal
Functionality testing techniqu
gaoliang641
20180324 leveraging unix tools
David Horvath
Qtp training session V
Aisha Mazhar
Design Like a Pro: Scripting Best Practices
Inductive Automation
Maintaining Code
Kelly Bauer
Tec314
John Art
The Easytrieve Presention by Srinimf
Srinimf-際際滷s
CHAPTER 1油Creating a ProgramOBJECTIVES揃 Analyze some of the i.docx
walterl4
C STANDARDS (C17).pptx
SKUP1
C STANDARDS (C17) (1).pptx
SKUP ACADEMY
C STANDARDS (C17) (1).pptx
SKUP ACADEMY

Small Things | Loosely Joined

Editor's Notes

  • #3: Introduction
  • #5: 13 Magazine Ad - Eddie Adams Work with John Walther. My craft as a photographer Next: Same process as a programmer.
  • #6: Main Problems: Everything is always changing. Life, business, economy, environment. Software must bend or break. We are limited: Memory 7 +/- 2. One Locus of Attention Systems are inherently interconnected. We are ill equipped to deal with complexity. - Gets big, then it gets buggy.
  • #7: Started looking - Found Pragmatic Programmer Led to Ruby, Rails, then Unix.
  • #8: Found that Generations of hackers and scientists had already solved the main problems. How to deal with change? how to deal with our limitations? how to keep systems form being overly coupled or connected? The most relevant of those traditions to FileMaker is Unix.
  • #9: How do you do it: How do you create systems that achieve the goals of the moment and are able to adapt to new needs and challenges.
  • #11: We are going to examine each of these points, looking at the philosophies and practices of others.
  • #12: HIred by Tekserve to Convert their 20 year system to 9 6 Months. Next up, rewrite the payment system. Old and ossified. Unable to change. Holding back the business. SHOW ONLY THE SAMPLE FILE WITH TECHNICAL DEBT
  • #55: Keep this slide at the end of your presentation. (Don't forget to remove this comment from the slide.)
  • #56: Keep this slide at the end of your presentation. (Don't forget to remove this comment from the slide.)