Planning the Application / Planning for Components
Subtitles of the Movie
Planning your code structure is a little different when you are using components. Because components are loosely considered objects, they are often described as Cold Fusion's answer to object oriented programming. You may want to keep in mind all the possible ways your application could be entered and then break up the functionality so that each approach can use it without requiring you to rewrite code. One goal when using components is to separate the data or content from presentation of the content. For example if you write a web page that uses a Cold Fusion component to access a database, Your goal would be to write the component in such a way that the same data retrieval could be used for display in a PDA. Components don't replace Cold Fusion templates. Components are called from Cold Fusion templates. Generally the process is to plan and chart out your components and then map out the pages that will use the components. This way you'll find it easier to break apart functionality you might have put all in the same template in previous versions. You might find it helpful to think about components the way you'll think about database tables. Handle like information together without duplication. Each component represents, more or less, an entity, that is something, that has properties, and can do something that has methods. We'll discuss components much more in depth later but for now we just want to sketch out our best assumptions for how to break them out. In our where's Tom application we'll use several components. To make sure I'm clear about what I need to build, I'm going to create a component map using Visio. You can use any software that you are comfortable with but be sure to create an over view of the components you want to use. In our diagram we've first put the application page at the top, Where's Tom. Underneath it I've added several of our components and the methods and properties for each component. We'll probably change this as we go along but this will give us a good starting point. You can see that I've already put in some of the components. Activity, location and supplies. We'll add a new component called user. A user has these characteristics or properties. LastName, Address and second line of address, City, State or Province, Postal Code, Country, Phone, Fax, Email, Cell Phone, Pager and instant messaging address. This component can handle these actions or methods. It can insert a new user, it can edit an existing user, it can validate a user, can search users and it can display information about a user. As I said we often forget particular items that need to be added to these in the planning process, and we'll add them as we go. So now we have a complete component map of the components we'll build in our "Where's Tom" application. as we go. So now we have a complete component map of the components we'll build in our "Where's Tom" application.
Tutorial Information
| Course: | Macromedia ColdFusion MX |
| Author: | Darcey Spears |
| SKU: | 33474 |
| ISBN: | 1932072772 |
| Release Date: | 2004-03-05 |
| Duration: | 6.5 hrs / 102 lessons |
| Work Files: |
Yes |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 81,350 Video Tutorials (20,800 free)
- Video Available as Flash or QuickTime
- Over 782 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 