Screencast: How to Build a Blog in 15 Minutes with Seaside

OK, I'll make this short and sweet. Here's a screencast of me building a super simple blog in Seaside in 15 minutes, similar to the Ruby demo screencast.

I use two frameworks here, Seaside, and Magritte, with a few custom extensions to my code browser to generate accessors with Magritte descriptions for me.

I tossed in a few required fields, and one business rule about duplicate post titles, to demo Magritte's abilities. I used the image for persistence, something I think greatly enhances development speed and enables rapid prototyping in a pure OO fashion; something you can't do if you're futzing around with database mappings and schemas.

This is my first time using screencast software, so there's no sound, and everything is real time, I didn't edit or speedup the video. I used a freeware capture program called CamStudio, it's very simple and doesn't allow editing. In the future, I think I'm going to need to find some better screencast software, the whole experience was a bit painful, but this will do for now.

If anyone knows any better free screencast software or formats to use, drop me a line.

UPDATE: The screencast is now in Quicktime and only 7 megs thanks to a reader Manuel Blanc re-encoding it for me.

UPDATE: In the video, I use a method called #contains: on the BlogPost collection, this method comes from the Refactoring Browser and is for compatibility with Visual Works. It may not be in your image, the equivalent Squeak method is #anySatisify: which #contains: simply delegates to.

UPDATE: For anyone who'd like an explanation of what I'm doing, Kevin Kleinfelter was kind enough to transcribe all the steps as if I'd done a voice over.

Comments (automatically disabled after 1 year)

Carl Gundel 6395 days ago

I use a free program called Wink for flash screencasts. I'm pretty happy with it.

Ramon Leon 6395 days ago

Tried it, didn't like it, chewed up tons of ram, crashed several times, and flash screencasts are limited to like 60,000 frames, which this 15 minute screencast wouldn't fit into. Maybe I was doing something wrong... any tips?

Steve Davies 6395 days ago

Love to watch your screencast, but with what software? On Mac, Mplayer shows it as a green screen; Windows Media Player and Quicktime won't play it either.

Thanks, Steve

Ramon Leon 6395 days ago

That's odd, I tested it on my buddies Mac, he had no problem playing it. He said something about using flip4mac. If I can find a better encoding or something, I'll update the file. I've tested it in Windows Media Player 10 and it works fine as well. Is there anything else you can tell me about your setup?

Charles Kens 6395 days ago

Windows Media Player is evil.

Use QuickTime.

Matt Revelle 6395 days ago

Thanks for doing this screencast, it's nice to see how someone with experience builds a Smalltalk application.

Had a couple questions, though. Why is the code browser morph titled "Sentorsa Browser"? Is that the name of the project? If so, is that how projects should be used in Smalltalk, for organizing development environments?

BTW, screencast plays on my Mac, OS X 10.4.8 and QuickTime Player 7.1.3.

Ramon Leon 6395 days ago

Sentorsa is a company name of mine, that's just my custom subclass of the Refractoring Browser. I added a few create "business accessor methods" to the selection menu that write the default Magritte descriptions for me automatically whenever I create accessors.

I organize my programs around packages, not projects, I don't even use projects. I use Monticello and package my code accordingly. The Refractoring Browser(available on Squeakmap) is a custom subclass of the Refactoring Browser, that lets you hide everything but the currently wanted categories and packages.

cark 6395 days ago

hmm, I am on mac and I cant see the screencast in vlc or quicktime. can you make a new one?

Ramon Leon 6395 days ago

My apologies, I'll attempt to re-record this one as soon as I find suitable software and some more time to burn, being my first attempt at a screencast, I expected a few road bumps. If you email me privately, I'll let you know when I update this one.

mj 6395 days ago

Excellent first screencast--it's exciting to see someone experienced showing how to work in Squeak. I would love to see more, especially with audio describing your design decisions and best practices advice. Keep it up!

mj 6395 days ago

P.S. I'm on a mac and QuickTime (v 7.1.1) worked just fine for me.

Carl Gundel 6394 days ago

I really enjoyed the screencast, and it was nice to see an example using Magritte. I had no trouble watching it using Media Player on my XP SP2 laptop.

Ramon Leon 6394 days ago

Thanks, it's good to hear people are liking the screencast, I guess I'll have to do some more soon.

[...] Via “On Smalltalk“. Tags: blog, Development, Magritte, Screencasts, Seaside, Smalltalk, Tutorial [...]

Lidell 6394 days ago

What a terrific screencast for showing how to get things done in Squeak and Seaside! It's very impressive.

I agree with others that some narrative would be very useful: either with sound narration, or even better with text (like a animated Powerpoint presentation).

I even found Squeak development to be somewhat appealing. I've avoided Squeak in favor of Dolphin Smalltalk, because the UI seemed so baroque and unintuitive, however your screencast has eased some of those reservations.

Very nicely done.

Darius 6393 days ago

Perhaps you could type in class & method comments as you're programming to easily provide the narrative the others are looking for.

Jason 6390 days ago

Nice screen cast. If you could type a little faster you could have been done in about 8 minutes. :) Very valuable stuff.

Ramon Leon 6390 days ago

Yea, I didn't prep enough, I kept having to stop and "think" for a second. What to name this, what to name that, what code to write. With a little more prep... or a little editing, I could cut out quite a few dead frames. It should be about half it's current length. Oh well, live and learn, I'll prepare a little more next time.

[...] Screencast: How to Build a Blog in 15 Minutes with Seaside [...]

rabble 6378 days ago

I tried to view it on a mac with MPlayer, VLC, QuickTime, and Windows Media Player 9. None of which worked. What codec DID you use to encode this crazy avi? I watch lots of weird avi's all the time, but never had one fail to play like this one.

Ramon Leon 6377 days ago

Media player 10 seems to play it fine, but I'll look into re-encoding it shortly and maybe even adding some audio, if I find the time.

doc 6376 days ago

Great demo. I agree with others that commentary would very useful... but I'd keep it realtime as even trivial comments could be helpful to beginners like myself.

PS: played fine on WMP v10.00.00.4019

Mark Miller 6376 days ago

I really liked this example. It's something that a lot of people can relate to. I had already seen the "blog in 15 minutes" example for Ruby on Rails (I think it was 15 minutes, too). So I could map some of what you were doing to that. The thing that intrigued me was you didn't use a database like the Ruby example did, but rather an OrderedCollection. I just had to give this a try and see how well it worked. Once I got it going I tried using two web browsers on it, and indeed it worked. The blog showed up the same in both. When I put in a new post or comment in one, it showed up in the other browser instance upon refresh.

A question I had at the end is whether this could be done in a real production site. Is OrderedCollection thread-safe, or does the fact that you're programming in an image make it so? I'm wondering if there was heavy traffic whether posts and comments would start getting dropped, because two people posted comments simultaneously and one person's comment was added to the collection but the other wasn't. Would simultaneous adds to the collection cause a problem?

The only comment I'd have about the screencast is it was a little hard to tell what you were doing with keyboard commands (obviously). I kept wondering how you were getting the Intellisense-like selections to come up. I finally figured it out, but it would've been nice if there were some subtitles showing when you had the browser accept code, and explaining how you were getting the method selectors to come up (just once), etc. Also the menu selections you made could've been a bit slower. They sometimes went a bit fast, because once you found the item you wanted, you immediately clicked on it, causing the menu to disappear right away. Rewind was my friend. :)

Anyway, great screencast.

Ramon Leon 6376 days ago

OrderedCollection is not inherently thread safe, but since posts are only added and not removed, I don't really see any issues with it. Worst case scenario, you could lock it when you add, but definitely if you remove.

Using the image like this for persistence should allow one to develop the entire application without the burden of dealing with a database. I do this not for use in production, but for use in development when speed of development is my primary concern.

Once complete, and working, you could then either use an object database like Gemstone, Goods, or Magma and pretty much keep the code as is, or use Glorp to map your objects into a relational database, which still shouldn't require many changes.

As for the keyboard commands, I did this on purpose, I can't stand watching screencasts where only menus are used because this isn't how real development is done. I wanted people to see what working in Squeak is actually like, for real development, not a dressed up nice mouse driven demo that doesn't reflect reality. Real developers use the keyboard, a lot, I wanted this reflected in the video.

I should have put sound on it, but honestly, it's hard enough writing and making videos, let alone voicing them, this is just a hobby after all, I don't want it to start feeling like work.

[...] The classic Ruby on Rails demo that usually gets presented is how to build a blog in 15 minutes. This is what you usually get with the RoR screencasts. Ramon Leon at On Smalltalk did a similar demo in his own screencast, “How to build a blog in 15 minutes”, using Smalltalk (Squeak) and Seaside, of course. A key difference between his demo and the one for RoR is he does not save blog entries and comments in a database like MySQL, but rather in OrderedCollections. [...] ]]>

[...] Screencast: How to Build a Blog in 15 Minutes with Seaside [...]

emptist 6364 days ago

thanks. By using freeware Wink it's easy to add sound and produce a flash. James Robertson is now using it. There're two tutorial flash come along with the software could be found under help menu.

Hope you would make a magma show. I've never got it run. sad.

Ramon Leon 6364 days ago

I actually already tried that, unfortunately, flash screencasts are only suitable for very short screencasts, they have a frame limit. Wink was unable to do this screencast for its length.

Maybe in the future, I'll focus on shorter terser screencasts and give Wink a try again. I'll think about the Magma one. What exactly would you like to see in such a screencast, its setup, or use?

[...] Screencast: How to Build a Blog in 15 Minutes with Seaside [...]

robert 6277 days ago

hi all. nice blog. its very ineresting article.

Andrey Esipenko 6277 days ago

Thank you for sharing your knowledge. I just want to ask how do you validate your BlogPost model for uniqueness of title attribute.

Taking into account that magritte validates form with a memento of object, specifying condition like [:value| (self repository contains: [:each| each attr = value]) not] just allow you to add a new model object once checking that attr is unique. But when you try to edit again that object, it just wont pass the validation, because condition will fail while comparing memento attr with the one already present in repository.

So, the question is: what's the right way to specify magritte validation of attribute uniqueness.

Ramon Leon 6277 days ago

Good questions. This is one of those things that I'd do in one way for a demo and another for a real application. Were this a real production application, I wouldn't have a uniqueness validation in the model itself, I'd use a constraint on the database and catch the exception on commit.

I added this rule to the Magritte descriptor mostly to demo Magritte. Something like validating uniqueness very much depends on your data store. Personally, I'm still torn between databases and objects, and this is an example of why.

In a db I could declaratively say this field must be unique. In an object model (OODB)... I'd be forced to ask myself why this field is unique, what does it say about my model, and then create an object for this abstraction and hash the posts in it by the unique key, the title. Essentially the same thing the relational database is doing by declaring a unique index.

So, assuming an OODB like this post does, I'd do it in Magritte maybe by moving the descriptor to the instance side and change the condition to the following...

[((self class repository copyWithout: self) 
    contains: [:each| each attr = value]) not]

Which essentially say make sure no "other" blog post has this title and would allow updates of this post. Uniqueness is one of those special things where the rule is really a rule on the set, not the object.

You know, now that I think about it, that rule doesn't really belong on the object at all, it belongs on the set of objects, the repository itself. So maybe what I'd really do would be to make the repository a real domain object rather than just a generic collection, and put this rule in the add method of the repository, and throw an exception when you add a post that violates one of its rules. Maybe something like this..

OrderedCollection subclass: #BlogPostRepository

add: aPost
    self testAdd: aPost.
    super add: aPost

testAdd: aPost
    (self includes: aPost) ifTrue: 
        [MAConditionError signal: 'Post has already been added.']
    (self contains: [:each | each title =  aPost title]) ifTrue:
        [MAConditionError signal: 'Another post has that title.']

Magritte would then catch the condition error and display the message to the user.

tv izle 6273 days ago

By using freeware Wink it's easy to add sound and produce a flash

John Borden 6232 days ago

The screencast is really nice, the only thing missing is a fileout of the code (I copied it to: here Changes: - #bold: is deprecated - #reverseDo: is more effecient )

Ramon Leon 6231 days ago

Right you are.

[...] Para que este post não fique só no blá-blá-blá, veja esta screencast, onde uma aplicação web é desenvolvida em quinze minutos (bem no estilo das screencasts do [...] ]]>

Maxime Bourreau 6206 days ago

I try building this blog, but I don't have a "Create accessors biz simple" item on the "selection..." submenu, only "Create accessors".

What can I do ?

Ramon Leon 6206 days ago

Download and use my image, which contains these enhancements.

Deleted 6194 days ago

I see you deleted my earlier comment. You smalltalkers are rich aren't you?

HTF do I "accept" the frikking instance of BlogView? this is the problem with smalltalk you just demand that everyone be up to speed even when doing a so called "introductory" screencast. And the transcript? well that one is a lot of help too.. Create BlogView and then ACCEPT how THE EFF do I accept?

80 miles an hour (to imitate that danish A-Hole) screencasts that don't make any sense and on top of that.. no sound and no explanations because we're supposed to know it already.. if we did, why would we watch your screencast? ever consider that?

seriously, if you're not going to do it properly, why even bother?

Ramon Leon 6194 days ago

If I deleted a post, it's because it looked like spam, or linked to a site that looked like spam.

You can accept either by right clicking for a context menu and accpeting, or by alt+s for save.

The screencast was meant to show you what it's like working in Smalltalk and Seaside. What it's really like (ie hotkey use), not what it's like in slow motion using the mouse for everything.

As with the Ruby demo, it's not meant to teach you Seaside, it's meant to peak your interest and make you look into it further. If you want to learn Seaside, screencasts aren't how you go about it, rather, go download some sample applications and play with actual code.

If you don't like how I did it, then don't watch it. I don't owe you or anyone else anything and what I offer here on my site I do in my spare time for my own enjoyment. I didn't have the time or equipment to do audio, so I did what I could, take it or leave it, I don't care.

Kurt 6172 days ago

Maybe consider uploading the screencast to youtube.

tommy 6104 days ago

this was informative ....thanks

Idetrorce 6005 days ago

very interesting, but I don't agree with you Idetrorce

about me|good books|popular posts|atom|rss