WITH CFBUILDER 2

viraginitysplashInternet και Εφαρμογές Web

10 Νοε 2013 (πριν από 3 χρόνια και 7 μήνες)

126 εμφανίσεις

by

Kri s Korsmo

EFFICIENT CODING
WITH CFBUILDER 2


Fami l i ari ze you wi th the I DE on a basi c l evel


Show you a few of the more advanced features


Show you some tri cks and hi dden gems (thanks Charl i e)


Di scuss di fferent devel oper workfl ows


Demonstrate creati ng a
si mpl e appl i cati on



THE GOALS OF THIS PRESENTATION


Li ve i n Seattl e area


Began codi ng w/ BASI C


Washi ngton State Uni versi ty


Usi ng Col dFusi on si nce 2004


Adobe Certi fi ed CF8


Seattl e CFUG member


Wi fe and three ki ds


737 Pi l ot when not codi ng

ABOUT ME

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Thi s presentati on i s geared toward


Folks with limited experience using an Eclipse
-
based IDE


Beginner to
i
ntermediate
-
level code writers


People interested in an efficient workflow


People who want to use best practices


I wi l l make no assumpti ons


I f you have questi ons I ’l l do my best to answer as we
go, but I may need to speed al ong at some poi nt


I f I don’t know the answer to your questi on I ’l l do my
best to fi nd i t. I ’d rather be honest i n not knowi ng than
gi ve you an answer that’s i ncorrect


There shoul d be ti me for more questi ons at the end

WHO THIS IS FOR

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


An Ecl i pse
-
based I DE


Eclipse is an open
-
source IDE


Not only a text editor


IDE = Integrated Development Environment


combines a lot
of features all in one to help you write code better, faster and
easier (although everyone has different preferences)


Tai l ored by Adobe speci fi cal l y for CF


Can be i nstal l ed as standal one or as pl ugi n

WHAT IS COLDFUSION BUILDER 2?

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Vi ews show
a si ngl e aspect of your appl i cati on


fi l es,
data, code sni ppets, etc.
-

and
can be added to any
perspecti ve


Perspecti ves are groups of rel ated vi ews whi ch together
hel p you work effi ci entl y on one aspect of your
appl i cati on (wri ti ng code, debuggi ng, etc.)


VIEWS & PERSPECTIVES

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

PERSPECTIVES

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

There are many different perspectives


six in
this case


but others are available

COLDFUSION PERSPECTIVE

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Extremel y useful i f you’re j ust
getti ng started wi th CFB


You can easi l y bookmark hel p
topi cs by ri ght
-
cl i cki ng and
sel ecti ng “Add Bookmark”


Handy HTML, JavaScri pt and CSS
references


Thi s i s where the CF10
documentati on l i ves

HELP VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Shows fi l e structure


Arrows are Forward and Back, not
Up/Down i n fi l e structure


Ri ght cl i ck and choose “Go I nto” to
navi gate fi l e structure


Cl i ck to navi gate up fi l e structure


Cl i ck to col l apse fi l e structure


Cl i ck to l i nk a fi l e to the edi tor


keeps the fi l e you’re worki ng on i n the
edi tor di spl ayed i n navi gati on vi ew.


Cl i ck to focus on a task


thi s i s a
Myl yn (Tasktop) feature


NAVIGATOR VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Cl i ck to open RDS confi gurati on di al og


Cl i ck to refresh the sel ected fol der


Cl i ck to open RDS Query Vi ewer


Cl i ck to go to RDS Data Home


Cl i ck to go i nto sel ected l evel


Cl i ck to go up a l evel


RDS DATA VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

RDS makes it easy to visualize your data and to
add it to the code in your editor.

RDS FILE VIEW


Cl i ck to open RDS confi gurati on di al og


Cl i ck to refresh the sel ected fol der


Cl i ck
to create a new fi l e


Cl i ck to
del ete a fi l e


Cl i ck to
create a new fol der


Cl i ck to
del ete a fol der


Cl i ck to go to RDS Fi l e Vi ew Home


Cl i ck to go i nto sel ected l evel


Cl i ck to go up a l evel


kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

Allows you to see the files on your remote server

SNIPPETS VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Cl i ck to refresh
sni ppets
vi ew


Cl i ck to
i nsert the sel ected
sni ppet


Cl i ck to create a new sni ppet


Cl i ck to
edi t the sel ected sni ppet


Cl i ck to
del ete the sel ected sni ppet


Cl i ck to
create a new package


Cl i ck to del ete the sel ected package


You can use system vari abl es to
automati cal l y popul ate val ues such as
the current date and fi l ename

Allows you to store frequently
-
used bits of code in an
organized fashion.



$${DATE}



$${MONTH}



$${TI ME}



$${DATETI ME}



$${CURRENTFI LE}


Cur r ent f i l e name (j ust the f i l e)



$${CURRENTFOLDER}


Cur r ent f ol der (The path to the contai ni ng f ol der )



$${CURRENTPATH}


Cur r ent path (f ul l f i l e name)



$${CURRENTPRJPATH}


Just the f ol der



$${USERNAME}


Cur r ent user



$${MONTHNUMBER}


Month as a number



$${DAYOFMONTH}


Day of month as a number



$${DAYOFWEEKNUMBER}


Day of week (the week star ts on Sunday)



$${DATETI ME24}


DateTi me24


a 24 hour cl ock ver si on of dateti me.



$${YEAR}


Cur r ent year.



$${YEAR2DI GI T}


Cur r ent two di gi t year

SNIPPETS SYSTEM VARIABLES

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

TASKS VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo



Shows the descri pti on of the task, the r esource, path & l ocati on



Doubl e
-
cl i cki ng the task opens the r esour ce i n the edi tor, and hi ghl i ghts
the l i ne(s) of code that need to be addr essed

OUTLINE VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Makes i t very easy to fi nd code


Most useful when worki ng on CFCs
because i t makes i t si mpl e to l ocate
functi ons by name


Cl i cki ng a secti on of code (such as
the functi on shown here) wi l l move the
cursor to that functi on i n the edi tor


You can expand and col l apse
i ndi vi dual i tems or use the buttons at
the top to expand or col l apse al l


Cl i cki ng the al phabeti cal sort i s very
useful because i t groups functi ons by
name, essenti al l y el i mi nati ng
comments


Cl i ck to hi de pri vate functi ons



Di spl ays the contents of your l og fi l es wi thout havi ng
to l og i nto the Col dFusi on Admi ni strator

TAIL VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

SERVICES VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Shows functi ons, arguments, data type, etc. and al l ows
you to ri ght cl i ck to i nsert cfi nvoke or createObj ect();

SERVER VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

NEW


Add, stop, start, restart or delete a server


Launch the Server Monitor


Launch the ColdFusion Administrator


START

RESTART

DELETE

INOP

GIT REPOSITORIES VIEW

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

www.eclipse.org/
egit
/


Doesn’t ship with CFBuilder


Not comprehensive


Will do what most of us need


Not supported by Adobe


Collapse All


Link to Editor


Add Local Repository


Clone Repo and Add to View


Create New Repository


Refresh View


Link to Selection


Hierarchical Branch Layout


Display Latest Branch Commit


Branch


Merge

Basic Functionality:

GIT HISTORY

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Can be done by navi gati ng to Wi ndow > Preferences


CUSTOMIZING CFBUILDER

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


Type “formatter” i n the fi l ter text

CODE FORMATTING

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


You can cr eate a custom CFML di cti onar y (XML f i l e) and make i t avai l abl e to
use f or Code Assi st and Tag wi zar d wi thi n Col dFusi on Bui l der
.


Wi thi n the Col dFusi on Bui l der i nstal l ati on, navi gate to the f ol l owi ng l ocati on:


\
pl ugi ns
\
com.adobe.i de.col dfusi on.di cti onary_
XXX
\
di cti onary


Cr eat e a f ol der cal l ed "Custom" wi thi n the Di cti onar y di r ector y
.


Cr eat e an XML f i l e to descr i be the custom tags and f uncti ons
.


For exampl e, i n the XML f i l e, you descr i be each tag
wi thi n

<tag></t ag>

el ements, and encl ose al l the tag el ements
wi thi n

<di cti onar y></di cti onar y>

el ement s as f ol l ows:


CODE LIBRARIES

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

<dictionary>


<tags>


<!
--

cfoanz

beerRequired
= “Boolean"
--
>


<tag endtagrequired="false" name="
cfoanz
"
single="true" xmlstyle="false">


<parameter name
=“
beerRequired
"
required
=“true"
type
=“Boolean">


<
values default="true">



<
value option="true"/>



<
value option="false"/>


</
values>


</parameter>


</tag>


</tags>

</dictionary>


http://ecl i psecol orthemes.org
/


Manually edit colors and fonts


Downloadable themes


Create your own theme


Plugin is available


Requires a lot of work & doesn’t look great


Only changes the editor, not the entire IDE


Adobe Source Code Pro font


New font designed specifically for coding


http
://sourceforge.net/projects/sourcecodepro.adobe
/


Differentiates similar characters


O
vs

0


l
vs

1


THEMING & FONTS

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

Function

Shortcut

<cfdump>

Ctrl + t, d

<!
---

comment

-
--
>

Ctrl + t, m

<cfscript>

Ctrl +

t, s

Wrap in hash marks (##)

Ctrl

+ t, h

<cfoutput>

Ctrl + t, o

<cftry> (both try

and
catch)

Ctrl + t, t

Move current line up,

down

Alt

+ ↑, Alt + ↓

Find matching tag*

Ctrl + Alt + m

Select enclosing tags*

Ctrl + Alt + b

Move

to next/previous attribute*

Ctrl + ], Ctrl + [

Format Code

Ctrl + Shift + f

See

all shortcuts

Ctrl + Shift

+ l

USEFUL KEYBOARD SHORTCUTS

* Courtesy of Charlie Arehart’s “Hidden Gems in ColdFusion Builder 2”


carehart.org

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


CFC Generator


CF Wheel s


Apptacul ar


Model Gl ue


Mach I I


CFLi b


Bui l d your own

EXTENSIONS

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo


E
-
Gi t


http
://marketplace.eclipse.org/egit


Gi tHub Myl yn Connector


http://bit.ly/TW43r1


Maven


http://bit.ly/TW3tt6


Cl oud Bees Jenki ns


http://
bit.ly/P3Wp0w


Androi d Devel oper Tool s


http://
developer.android.com/tools/sdk/eclipse
-
adt.html


Ecl i pse Marketpl ace wi thi n the I DE


Help > Eclipse Marketplace


PLUGINS

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

CFBuilder

Dreamweaver

Sublime

IntelliJ

Text Editor

Good

Good

Great

Good

Code Completion

Great

Good

Great

Good

Debugging

Built
-
in

In
-
browser

In
-
browser

In
-
browser

Database Info


Yes

Yes

No

No

Version Control


Via Plugin

Via Plugin

Via Plugin

Built
-
in

Console

Yes

None

Yes

Yes

Extensible

Yes

Yes

Yes

Yes

Theming / Fonts


Fair

Poor

Great

Fair

Documentation

Good

Good

Fair

Great

CFBUILDER VS. OTHER EDITORS

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

DEVELOPER WORKFLOW

Typical Development Process

Best Practices Development Process

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

Write Code

Test Locally

FTP to Production
Server

Write Code

Commit Frequently

Push to Repository

Push to Production Server

Selenium

Unit Testing


We’l l start wi th onl y a database


Generate an appl i cati on usi ng Apptacul ar


Use code sni ppets to add gri d functi onal i ty


Commi t and push to reposi tory


Run
uni t tests


DEMO APPLICATION

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

QUESTIONS

kriskorsmo.com | kriskorsmo@gmail.com | @kriskorsmo

All

CF
.
Objective
(ANZ)

attendees

will

receive

a

20
%

discount

on

web

hosting

with

Ayera

Technologies
.

Use

the

Discount

code

CFOANZ
2012

or

mention

my

name

in

the

referral

section
.