Sunday February 7, 2010 10:44 PM
Word Count: 104
I am big fan of picking up other languages. I think they are important for developers to advance their programming skills. One of my favorite languages around is Groovy. Grails is an open-source web application framework that's all about
getting things done. At the very core of Grails is Groovy and some other popular frameworks such as Hibernate and Spring. If you want to learn Grails I have an awesome resource for you that just happens to be free. Head over to InfoQ and download the second edition of Getting started with Grails for free.
Thursday January 28, 2010 5:13 PM
Word Count: 265
I have been working on some updates to Hyrule lately and I came across a situation where I had one of those "I wish I could do this" moments. ColdFusion (along with php,asp,etc...) is a loosely typed language. This just means that you don't have to declare a data type of a variable in the language. In other languages such as Java (strongly typed) you must assign a variable a data type. I am not going to get into the pros and cons of both because you can do a quick search and find that out for yourself.
So I am working with a component that has a single function, isValid(). From the name you can probably gather that its going to evaluate some data and return a boolean. The component we are going to use as an example here is the MinValidator.cfc.
Don't worry to much about the component itself, lets focus on its task. This component accepts a struct that may look something like this.
[More]
Thursday January 28, 2010 1:45 PM
Word Count: 275
Today I was trying to run this very basic query.
When I ran the query I got the following error.
>[Error] Script lines: 1-4 --------------------------
ORA-01843: not a valid month
For whatever reason it did not like the month. A little hunting around and I found some information about date formats in Oracle. Unless you set some type of client environment variable it will run off of the database default. If you need to find out what that is you can run the following sql.
Looking at the session parameters I was able to identify that the default NLS_DATE_FORMAT was set to 'DD-MON-RR'. As I said before, I think you can change this in your environment but I just updated my query.
If anyone has something to add to this please feel free, I am a complete newb when it comes to Oracle.
Monday January 25, 2010 12:30 PM
Word Count: 274
With the upgrades of cfscript in ColdFusion 9 I am starting to see a lot more components written in script(Yes!). With that I am starting to see a lot of the following.
First off Its just a personal preference but attributes after the method arguments is really ugly. If you notice the output for both the component and the method has been set to false. While this was needed in tag based components this is not required in script based components. Nathan Strutz has a really good explanation of this over on Stack Overflow . Nathan's short answer is below but I would head over to the site and check out the full explanation.
cfscript does not output anything unless you explicitly call writeOutput() from it. This includes functions in cfscript as well as any cfscript code outside of a function.
This is different from CF tags' syntax, which, by default, output at least whitespace between the tags. In cfscript, any text you write will be compiled by the CFML engine. in CF tags, any text you write will be written to the output buffer and sent to browser.
Thursday January 21, 2010 8:27 PM
Word Count: 178
This is just a quick reminder to everyone about the wonderful pre conference training sessions going on at cf.Objective() this year. I know all of the speakers and can easily say that these are going to be some awesome classes. Hurry up and sign up today for one of these great training sessions.
- Building Secure CFML Applications (April 21) - Jason Dean and Pete Freitag
- Coldbox:100 Training (April 21) - Luis Majano
- Developing Applications with ColdFusion 9 Object Relational Mapping (ORM) (April 20-21) - Bob Silverberg and Mark Mandel
- Getting Started with Flex and AIR Development with the Flex SDK (April 21) - John Mason
- Mach-II and OOP from the Ground Up (April 20-21) - Kurt Weirsma, Peter Farrell and Matt Woodward
- Rapid Development with Model-Glue 3 (April 20-21) - Dan Wilson and Ezra Parker
Monday January 18, 2010 6:00 PM
Word Count: 122
I am really happy to announce that I have been selected to the Adobe Community Professional program for 2010. You can read more about it on Liz Frederick's Blog. Basically there are only 300 people worldwide selected for this program across a number of products. I am 1 of 44 ColdFusion professional's selected and could not be more excited about it. Big thanks to everyone who nominated me and an even bigger thanks to Adam Lehman who I know went to bat for me this year. I really enjoy doing my part in this awesome community and it's nice to see my work paying off! Let's all make 2010 one to remember.
Monday January 18, 2010 10:26 AM
Word Count: 308
There will come a time when you need to add a calculated value to your entity. In this example we will look at why you would want to do this and how you can easily accomplish it. I whipped up a very simple user manager example. First we have some orm settings in our application component. The main thing to get out of this is that we are going to be using event handling.
Our user entity is very basic and there is nothing special going on at this point.
Now what if we wanted to display the users age somewhere in our code? We could easily do something like this.
[More]
Sunday January 10, 2010 10:56 PM
Word Count: 409
Today a friend asked me to look over some code he wrote using an MVC framework. One of the first things I noticed was that there was just to much logic going on in some of the views. I would see code that was directing the behavior of the view which is a big no no, we will get to that in a second. In the edit forms for a product I saw logic like this.
You may not realize it but by doing this your actually breaking one of the key concepts of MVC. The view should only concern itself with presentation and it should always look to delegate to the controller for its logic. The reason we do this is to keep modularity by maintaining loose coupling with the controller. A better way of handling the issue above would be to delegate this logic to our controller.
I guess the main point of this entry is to remind us (I make the same mistake) that just because we use a framework doesn't mean your work is done. You still need to be mindful of why you are using it in the first place!
Wednesday January 6, 2010 9:28 PM
Word Count: 365
So in my last post I was able to get some pretty awesome feedback on some questions I had. I am not going to go over everything about the post so please check it out first and read through the comments. In the end I wanted to find out how I could abstract commons functionality of the persistence layer in my application. What I am starting with here is by no means the *right* answer or my final, just my first stab.
I am going to use the cfbookclub datasource that ships with ColdFusion 9 so you can follow along at home. First we need to setup our application. This is my basic directory structure for the application and below is my Application component.
[More]
Wednesday January 6, 2010 3:52 PM
Word Count: 109
I am so happy to announce that I will be speaking at cf.Objective 2010. My presentation is "ColdFusion 9: A New Way of Building Applications" and I am really excited about this one. We are going to cover some of the new features in ColdFusion 9 and how they help us be more productive as developers. This not a whats new in CF9, more of a exploration of how we use to develop applications and how we that has changed today! I hope everyone can come to cf.Objective this year and I hope you will check out my presentation.
More Entries