The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Smalltalk Server Pages stuff

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Smalltalk Server Pages stuff Posted: Nov 11, 2005 11:42 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Smalltalk Server Pages stuff
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Awhile back, I did a brief introduction of servlets in Cincom Smalltalk. I thought I'd take a brief look at the other side of that - the SSP pages themselves. SSP pages can be written with jsp tags, which is nice for developers who are already familiar with that - you just create Smalltalk code on the back end that matches the tags.

That's not what I wanted to talk about though - when I create SSP pages (like the ones for this blog), I just embed Smalltalk code in the page. Now, you can quickly go down the road to hell that way - what I've done over the last year is to make the Smalltalk code on the pages be API calls into the server - on the main page, for instance, the code that grabs whatever posts that should show up looks like this:


			<div id="posts">

			<div class="watermark"></div>

				<%= saver fetchBlogCSSBasedOn: pageArgs andBlogEntry: specificBlog. %>

			</div> 

The "saver" there is a reference to the blog object itself (there's one per blog). The method being invoked determines what items to fetch, and formats them accordingly - all the logic is back in the server rather than on the page. What that means is that I've defined an API that I need to maintain, but I haven't created a huge set of code that lives in an HTML page.

Here's the cool part though - say that I make modifications, and - for whatever reason - it's not working quite right in my test environment. Well - I can slap a breakpoint into the API method, and run into the debugger:

That lets me walk into the debugger at the point of the API call and see what's happening. It looks like this (click the image for a bigger image):

Debugging a Web Page

If you get the bigger image, notice that second line, which reads "unbound method"? That's the web page itself - in Cincom Smalltalk, that comes across as code akin to workspace code - i.e., fully debuggable. This is part of what makes Smalltalk such a nice choice for web applications - you don't need a whole peripheral set of tools in order to debug them - you just do what you normally do, using the same tools that you use when creating any other kind of Smalltalk code.

That's the power of Smalltalk - consistency and simplicity.

Read: Smalltalk Server Pages stuff

Topic: Australian 8-Ball Championships - Warm Up Event Previous Topic   Next Topic Topic: Looking at the subscriptions

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use