Entries Tagged as 'JavaScript'

HTML5 and WebGL - Things are going to get exciting on the web again!

webgl , standards , JavaScript

WebGL LogoThankfully, I pull my head out of the sand once in a while to see what's going on out there in the world of web development. It seems that this tme I looked up to stare into the face of the WebGL standard that's coming into the scene.

For some nifty links on WebGL, see my Delicious bookmarks.

Prior to the last 10 years that I've spent developing web applications I had spent five or six years engaging computer graphics with a focus in 3D and animation. In 2000 I obtained Autodesk (was Alias then) Maya certification levels I and II. That was lightyears ahead of where I began, which was with a DOS command-line ray tracer called Polyray. This antique of the graphics world used a C like syntax to describe scene worlds that were then rendered - arduously over hours and hours, during which my father would demand to have his computer back - into a series of image files.

Now it's 2010 and it's coming full circle. I began scripting 3D scene worlds in 1993 with a ray tracer and now I can once again script them but this time it's bigger. WebGL is fully interactive with the JavaScript layer of the web browser. The applications and mashup potentials here are overwhelming! I've got 30 ideas rushing through my head and it's time to start immediately. Visualization has always been a boon for data analysis, and this is going to be key to my experiments.

For now, I've got some reading to catch up on and some shader languages to learn.

Private instance vars show when JSON serialized in CF9

coldfusion , JavaScript

This is something I found interesting tonight. I made a CFC that sets private (variables scope) variables from the init parameters. They were not available by accessing them as obj.property, as expected. But when run through the serializeJSON function, those became available. I didn't expect this, but I think it's going to be handy for using them as lightweight transfer objects.

Why do people forget about JSStringFormat?

coldfusion , JavaScript 560 Comments »

I thought it was worth a quick post before I call it a night. Lately as I converse with colleagues who are getting more and more into the whole "Web 2.0" thing and therefore using more AJAX and JSON, I notice I'm sometimes the only one in the circle who recalls the awesome ColdFusion function JSStringFormat.

With this function you can take any amount of content and make it JavaScript friendly - you know, escaping single quotes and all that jazz. Even better is when you couple it with the cfsavecontent tag. Check this out, it's how I make a no-flash display.

<cfsavecontent variable="foo">This is some markup, can contain tons and tons of tags, even other script, etc.</cfsavecontent>
<cfoutput>
<script language="text/javascript">
var foo = '#JSStringFormat(foo)#';
</script>
</cfoutput>

ColdExt, the ExtJS Gateway Drug

coldfusion , extjs , JavaScript , Framework , AJAX , cftags 300 Comments »

Quick post tonight, as I'm between tasks. I've been wanting for a long time to get more familiar with ExtJS, a most excellent JavaScript application framework (can I call it that?). It's the good stuff that's built into ColdFusion 8, but that was version 1.1. Since then they've gone all the way to 3.0, and the platform is getting better and even more expansive.

What I wanted to do was get into it, but I kept getting sidetracked. It can be a bit to digest in one sitting - or even 10. Eventually, I heard of ColdExt, which is a ColdFusion, er, helper application... well, it's like training wheels. I hope that doesn't offend anyone - particular the ColdExt gang. It's really amazing what they've done. Using their imported tags you can get off the ground really fast using the familiar tag-ness that is ColdFusion but when it's processed and sent to the browser it's all proper ExtJS JavaScript.

Now, I LOVE this. What it's doing is providing me, the developer, those all-important positive and productive feedbacks we call "success". In no time I had an AJAX-powered grid with a CRUD form hooked up to the rows. Even better is that some of the things I wasn't completely familiar with in the ExtJS syntax was getting written for me. A quick view-source and I was staring at a guide for how the under-hood-goods were written. This has helped me gain mountains of comfortability with this JavaScript framework!

So, even if you don't want to use ExtJS through a layer of ColdFusion tags in the end, I highly recommend you ease into the deep and incredibly powerful world of ExtJS via ColdExt. It put the "RAD" back into my AJAX/Rich Client applications. That's just awesome.

Getting a DTO/VO out of Transfer-ORM via ColdSpring remote proxy

transfer , ORM , JavaScript , AJAX , coldspring 344 Comments »

I'm working awfully hard these days to be a lazy S.O.B. What I'm trying to do right now is figure out how I'm going to send and receive a simple JSON data chunk that represents a business object (a "data transfer object" (DTO), a.k.a. "value object" (VO) or just "transfer object" (TO)) to and from a remote proxy bean (CFC) generated by ColdSpring AOP. This is not hard to do. What's become an unexpected challenge, however, is when that remote proxy bean is a Transfer factory (from the awesome ORM framework by Mark Mandel).

If you don't know already, here is what will happen with a class pulled out of the Transfer factory when slurped down a remote access pipe; as a part of the process of translating it to a JSON string to send back to my AJAX call, ColdFusion will only turn public, visible properties in the ColdFusion component into JavaScript object properties. This doesn't serve me well because Transfer will not expose any data properties. Rather, it makes getter and setter methods for each property - which I love! But I don't love it for trying to bounce objects back and forth via AJAX/JSON.

All that I've said so far makes it difficult to receive object data without some custom service layer nonsense (I'm lazy, remember?) But just as frustrating is that there doesn't seem to be a simple way to pass an argument collection of property name-value pairs to a constructor in the Transfer factory to create a new object or update one. There is a get method which will return a new class of the requested type, but no way to send in a struct full of default values, which is what I would push up to the service layer via AJAX in my RIA.

Am I going to have to write a custom service layer after all this? I've been poking and prodding for hours here trying to avoid this work.οΎ  :) Yes, I fully appreciate the irony in this. I'm a geek, it's what I do.

Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds