Prelude to Fusebox The Basics cfinclude cfmodule cfswitch

Скачать презентацию Prelude to Fusebox The Basics cfinclude cfmodule cfswitch Скачать презентацию Prelude to Fusebox The Basics cfinclude cfmodule cfswitch

595224dac1196074537785ebc8c73efd.ppt

  • Количество слайдов: 38

Prelude to Fusebox The Basics: <cfinclude> <cfmodule> <cfswitch> - <cfcase> <cfapplication> Variable scopes: session/client/application/request/attributes/caller Prelude to Fusebox The Basics: - Variable scopes: session/client/application/request/attributes/caller Custom Tags URLToken

Fusebox Changes The World! How lazy coders make big bucks Compiled by the Fusebox Fusebox Changes The World! How lazy coders make big bucks Compiled by the Fusebox Community with the help of Hal Helms and Steve Nelson

The situation with web application development these days. . . Skilled craftspeople are needed The situation with web application development these days. . . Skilled craftspeople are needed to create the product. Each product is a unique work of its creator. There is a shortage of skilled workers. There is a wide variation in the quality of finished goods. Maintenance of our products require the user to go back to the creator or to employ the skills of a highly-paid master craftsperson. There is no ability to interchange parts from one product to another. There is very limited division of labor. There is no efficiency of scale: it takes 10 times as long to produce 10 products.

A CF Programmer’s Dream World. . . Imagine if…. You could work in a A CF Programmer’s Dream World. . . Imagine if…. You could work in a team of developers and have all the code look like it was written by single person. You could understand the structure of your co-workers code in 5 minutes, without asking questions. You could concentrate on solving the problem instead of thinking about how to write the application. Nice, huh?

Why use a Structured Architecture? File based applications get messy. A structured architecture helps Why use a Structured Architecture? File based applications get messy. A structured architecture helps to clean this up. Multiple person development is more easily facilitated – without stepping on toes. If your structure is clearly defined, your application documents itself. You only focus on the client’s problem instead of the application’s architecture.

What is Fusebox? Fusebox is: A structured application architecture for building web applications, primarily What is Fusebox? Fusebox is: A structured application architecture for building web applications, primarily using Cold. Fusion. A methodology of coding so you can use others’ labors without feeling guilty - as if you ever did. An open-source project, created by the Cold. Fusion community for the Cold. Fusion community. Quick to learn. Adopt as much or as little as you want. Flexible and extensible. There is no Fusebox Gestapo to make sure you followed all the rules. Free.

Before You Write Any Code Talk to the client about general ideas, business requirements Before You Write Any Code Talk to the client about general ideas, business requirements and specifications. With the client on-hand, write down these ideas into a loose specification. Better yet, have him/her do it. Create a tight specification from the loose specification. Figure out all the sections of the application and all the actions required to do everything the client wants the application to do. Repeat this process until every action in the application is understood by everyone involved. Write a Fusedoc for the application from these use-case scenarios.

Create the Directory Structures Use the tight specification to figure out all the sections Create the Directory Structures Use the tight specification to figure out all the sections of the application. Each section is given its own directory; these sections are known as “Circuit Applications”. A circuit application is a section of the overall home application. Examples: n n n www. ebags. com/search www. autobytel. com/customerlogin www. ecommerce. com/cart

Create the Index. cfm Files Every directory (circuit application) has one index. cfm file. Create the Index. cfm Files Every directory (circuit application) has one index. cfm file. Index. cfm controls all the Fuseactions of that circuit application. It is the Fusebox. All links and form submissions go to the index. cfm. It is a single statement with multiple statements. Each is a different Fuseaction.

Fusebox Anatomy: the Fusebox (index. cfm) <!--index. cfm--> <cf_form. URL 2 attributes> <cfinclude template=“app_globals. Fusebox Anatomy: the Fusebox (index. cfm) Fusebox . .

The Fusebox Architecture http: //index. cfm? fuseaction=login This is Meant to Be Just text The Fusebox Architecture http: //index. cfm? fuseaction=login This is Meant to Be Just text That isn’t Clear. I hope It works the Way I want It to. Fusebox dsp_User. Login. cfm

The Fusebox Architecture http: //index. cfm? fuseaction=login This is Meant to Be Just text The Fusebox Architecture http: //index. cfm? fuseaction=login This is Meant to Be Just text That isn’t Clear. I hope It works the Way I want It to. http: //index. cfm? fuseaction=validate. User Fusebox

Create the Fuseactions A Fuseaction is made up of one or more. cfm files. Create the Fuseactions A Fuseaction is made up of one or more. cfm files. Determine what types of files (display/action/query) are needed to create each Fuseaction. Create a CFCASE statement for each Fuseaction and CFINCLUDE each necessary file.

Conventions, Extensions, and Rules File Naming Conventions Fusedocs <cf_formurl 2 attributes> Conventions, Extensions, and Rules File Naming Conventions Fusedocs

File Naming Convention (Fuses) app_globals. cfm - Global variables, one per Home application app_locals. File Naming Convention (Fuses) app_globals. cfm - Global variables, one per Home application app_locals. cfm - Local variables, one per Circuit application dsp_filename. cfm - Display files act_filename. cfm - Action files qry_filename. cfm - Query files

Fusedoc: A Documentation Standard A Fusedoc outlines responsibilities, customizations, and expectations. A Fusedoc is Fusedoc: A Documentation Standard A Fusedoc outlines responsibilities, customizations, and expectations. A Fusedoc is a collection of Fusecards which are granular to the actions and steps of the application. A Fusecard contains the following elements: n n Fusename Responsibilities (hopefully non-technical, in plain English) Author / Coder Variables list (incoming, outgoing, and persistent)

Fusedoc Legend --> <-<-> ++> explicitly passed incoming parameter explicitly passed outgoing parameter pass-thru Fusedoc Legend --> <-<-> ++> explicitly passed incoming parameter explicitly passed outgoing parameter pass-thru parameter (unchanged) existing persistent parameter (session, client, etc. ) <++ created persistent parameter +++ included file [parameter] indicates optional Examples: --> Current. User: a WDDX STRUCTURE <-- [bad. Login]: a STRING <++ Session. Color. Choice: a STRING (Red|Blue) <-> User. ID: an INTEGER +++ my. Globals. cfm

Sample Fusecard / Fusestub <!-- dsp_User. Login. cfm Author: hal. helms@Team. Allaire. com --> Sample Fusecard / Fusestub User. Name: a STRING indicating the user’s name --> Password: a STRING indicating the user’s password --> DSN: a STRING of the ODBC datasource name to use to verify --> Table. Name: a STRING of the table name to use to verify END FUSEDOC--->

What’s in a Fuse? 1. 2. 3. Fusedoc [HTML] Code • The perfect fuse What’s in a Fuse? 1. 2. 3. Fusedoc [HTML] Code • The perfect fuse is small and has a very narrow focus.

Create the Necessary Files (Fuses) All links and forms in the display files should Create the Necessary Files (Fuses) All links and forms in the display files should point to one of the index. cfm files in the application, never to the specific dsp or act files. All links and forms must specify which Fuseaction they point to. A hint now, for advanced Fusebox techniques: Use the “attributes” scope instead of form/url scope. This allows you to call the index. cfm file as a custom tag.

Fusebox Anatomy: a fuse <!-- dsp_User. Login. cfm Author: hal. helms@Team. Allaire. com --> Fusebox Anatomy: a fuse I am a fuse… A Fuse

Name: Password: < br>

Putting it all Together One home application is made up of many smaller circuit Putting it all Together One home application is made up of many smaller circuit applications. One circuit application is made up of a directory of files. Each circuit must contain an app_locals. cfm and index. cfm file plus other display/action/query files as Fuses. One index. cfm file is made up of one or more Fuseactions. One Fuseaction includes one or more display/action/query files plus any necessary CFML logic.

Extending Fusebox This is Meant to Be Just text That isn’t Clear. I hope Extending Fusebox This is Meant to Be Just text That isn’t Clear. I hope It works the Way I want It to. ? ? Fusebox This is Meant to Be Just text That isn’t Clear. I hope It works the Way I want It to. User. Manager This is Meant to Be Just text That isn’t Clear. I hope It works the Way I want It to. ? ? Circuits This is Meant to Be Just text That isn’t Clear. I hope It works the Way I want It to. Shopping. Cart This is Meant to Be Just text That isn’t Clear. I hope It works the Way I want It to. Company. Info

Building A Fusebox Shopping Cart Display Fuses n show. Cart. Summary n show. Catalog Building A Fusebox Shopping Cart Display Fuses n show. Cart. Summary n show. Catalog n show. Item Action Fuses n add. Item. To. Cart n remove. Item. From. Cart n clear. Cart We’ll look at: n only Fusedocs for individual Fuses. n code for app_locals, app_globals, index. cfm.

The Shopping Cart Array Implement shopping cart as 2 d array item. ID quantity The Shopping Cart Array Implement shopping cart as 2 d array item. ID quantity description price 2105 2 Cold. Fusion To Go 49. 99 3995 1 Fusebox Essentials 99. 99

The Cart Summary page <!-- dsp_Cart. Summary. cfm Author: hal. helms@Team. Allaire. com --> The Cart Summary page

The Catalog page <!-- dsp_Catalog. cfm Author: hal. helms@Team. Allaire. com --> <!---FUSEDOC || The Catalog page request. DSN: a valid ODBC DATASOURCE <-- [item. ID]: a PK from Items table <-- quantity: an INTEGER END FUSEDOC--->

The Item page <!-- dsp_Item. cfm Author: hal. helms@Team. Allaire. com --> <!---FUSEDOC || The Item page <-<-END request. DSN: a valid ODBC DATASOURCE item. ID: a valid PK from Items table [item. ID]: a PK from Items table [quantity]: an INTEGER FUSEDOC--->

Adding an item to the cart <!-- act_add. Item. cfm Author: hal. helms@Team. Allaire. Adding an item to the cart item. ID: a valid PK from Items table --> quantity: an INTEGER --> request. dsn: a valid ODBC DATASOURCE ++> session. shopping. Cart: a 2 D ARRAY with columns of item. ID, quantity, description, price END FUSEDOC--->

Removing an item from cart <!-- act_remove. Item. cfm Author: hal. helms@Team. Allaire. com Removing an item from cart item. ID: a valid PK from Items table ++> session. shopping. Cart: a 2 D ARRAY with columns of item. ID, quantity, description, price END FUSEDOC--->

Clearing the cart <!-- act_clear. Cart. cfm Author: hal. helms@Team. Allaire. com --> <!---FUSEDOC Clearing the cart

The Fusebox – index. cfm <!--index. cfm--> <cfinclude template=“app_locals. cfm”> <cfswitch expression=“#attributes. fuseaction#”> <cfcase The Fusebox – index. cfm

App_Locals. cfm <!—app_locals. cfm--> <cfinclude template=“. . /app_globals. cfm”> <cfparam name=“attributes. fuseaction” default=“main”> <cfif App_Locals. cfm

App_Globals. cfm <!—app_globals. cfm--> <cf_formurl 2 attribues> <cfparam name=“attributes. fuseaction” default=“main”> <cfapplication Name=“Nats. Fusebox. App_Globals. cfm

Congratulations! That’s all there is to Fusebox. Not too scary, eh? Congratulations! That’s all there is to Fusebox. Not too scary, eh?

Current Enhancements to Vanilla Fusebox <cf_bodycontent> Application. cfm <cfif List. Last(Get. Template. Path(), '') Current Enhancements to Vanilla Fusebox Application. cfm Return fuseactions Exploded Benchmarking for 4. 01 HKEY_LOCAL_MACHINESOFTWAREAllaireCold. FusionCurrent. VersionDebug String Value: Write. Exploded. Benchmarking. Info=1

Conclusion: Why use Fusebox is (most likely) very similar to how you may already Conclusion: Why use Fusebox is (most likely) very similar to how you may already build an application, thus it will be easy to learn. It is a well thought out process, and will continue to be improved by the CF community. It’ll save you time, which will save you money. Cut-n-paste your way into completed applications. (No, really. I’m serious!) Most importantly it will prevent hair loss.

Fusebox Resources http: //www. fusebox. org n Old white paper, etc. http: //www. houseoffusion. Fusebox Resources http: //www. fusebox. org n Old white paper, etc. http: //www. houseoffusion. com n Fusebox mailing list http: //www. team. Allaire. com/hal/ n Fusebox primers http: //home. san. rr. com/natp/fuseboxnframes. zip n Source code for using Fusebox and frames happily http: //www. fuseml. org n Incorporating UML and Fusebox.




  • Мы удаляем страницу по первому запросу с достаточным набором данных, указывающих на ваше авторство. Мы также можем оставить страницу, явно указав ваше авторство (страницы полезны всем пользователям рунета и не несут цели нарушения авторских прав). Если такой вариант возможен, пожалуйста, укажите об этом.