Smalltalk usage in a RAD Race

I recently participated in an internal RAD Race at my Employer QNH. A former collegue of mine from Nationaal Spaarfonds and I decided to participate using VA Smalltalk, Seaside and the component framework we call Wolluk.

But alas, we didn’t win…

We had some strong competition who used microsoft .net to generate the complete CRUD application and only filled need to fill in the blanks. Although we did finsih some nice wizard like UI’s for the RAD Race, we lacked in the autogenerated part, so we enden up second. not bad, but could be better.

So I started thinking where we went wrong. First of all: a RAD race is about functionality and not architecture. To auto generate 70% from the datamodel instantly adds points to your score.

Unfortunatly, My friend and I didn’t have enough experience with auto generated UI’s so we ended up coding everything our selves. Lessens learned…

I kwew of a framework called magritte which you can use to add meta descriptions to your classes. This week I will investigate this further and will check how I can integrate this with our wonderfull component framework called Wolluk to generate the whole application from the model.

 

 

 

 

Leave a Comment

Building an Envy Application Browser in Smalltalk

It’s bin a while, but here we go :)

A collegue of mine runs www.vastgoodies.com. A place where VA Smalltalk developers can share their open source projects and tools.

VAStGoodies created by a3aan

At home I use Pharo Smalltalk for my hobby projects, so stuff developed at work  (like nice plugin wrappers for jqGrid and jsTree) all need to be ported manually to Pharo which is a pain to do.

So I came up with the idea to create a Monticello repository client in Pharo and extend vastgoodies.com to export Monticello Packages using some conventions which will only fit MY needs. I know there are many differences between the dialects, but if it can exchange my plugin wrappers and other cool seaside stuff using standard conventions my goals are achieved :)

To get to know Envy, i wanted to start with something simple. The Browse button for applications was showing a place holder for a application browser so I decided to start with that.

The basic layout for the application browser consists of 4 columns with a 2 tabs at the bottom.

The first columns shows al the applications in the configuration map, the second shows the classes in the selected application, the third lists the categories in the selected class and enables the user to select the instance or class side of the categories.

And the fourth column shows the methods in that protocol. Multiple protocols can be selected and it will list all methods in these protocols.

The first tab shows the Class definition and the second the method source.

Once you click on a method, the source code is shown with a Syntax Hihglighter using the Smalltalk Brush created by Daan van Berkel.

Some more details….

A3aan already wrote a Envy Library Accessor which I extended to retrieve the extra data from the Envy repository. All operations on the Envy Repository are mutally exclusive, which means that no process can access the repository at the same time. This support was already built in, so I just used that :)

EnvySeasideLibraryAccessor>>applicationsFor: aConfigurationMapOrNil

	(aConfigurationMapOrNil isNil)
		ifTrue: [ ^#() ]. 

	^self do: [ aConfigurationMapOrNil shadowApplications ]
EnvySeasideLibraryAccessor>>do: aBlock

	"No problem to call this nested (from one process).
	Nesting is faster then repeated call anyway."

	^[Mutex critical: aBlock] ifCurtailed: [EmLibrary startUp]

The applicationsFor: returns a collection of  EmShadowApplication instances where I would only like to print the signature in the list.

EnvySeasideConfigurationMapVersionBrowserComponent>>renderAppColumnOn: html 
	(html select)
		size: 20;
		on: #app of: self;
		list: self applications;
		labels: [:each | each signature];
		onChange: (html jQuery ajax serializeThisWithHidden script:
						[:s |
						category := nil.
						method := nil.
						className := nil.
						self renderRerenderClassScriptOn: s.
						self renderRerenderCategoryScriptOn: s.
						self renderRerenderMethodScriptOn: s.
						self renderRerenderContentsScriptOn: s])

When the onChange event fires, I reset the instance variables category, method and class name and rerender the columns and content pane on the bottom.

EnvySeasideConfigurationMapVersionBrowserComponent>>renderRerenderClassScriptOn: s
	s << (s jQuery id: #classColumn) html: [:h | self renderClassColumnOn: h]

Interaction with the other select lists is done in pretty the same way.

Getting the source code is also a very simple operation:

EnvySeasideLibraryAccessor>>sourceCodeFor: aSelector in: aShadowClassInstance
	^self do: [aShadowClassInstance sourceCodeAt: aSelector ifAbsent: ['']]

Where do these shiny colors come from?

Using the syntax highlighter supplied described above works pretty well if the source code content is already in the DOM before you call the syntax highlighter.

But if the source code is loaded using a ajax call, the syntax highligher does not know it needs to redraw the preformatted area.

Luckily, the syntax highlighter can be invoked to restyle the preformatted area pretty easily.

EnvySeasideLibraryAccessor>>renderRerenderContentsScriptOn: s
	s << (s jQuery id: #classDef) html: [:h | self renderClassDefOn: h].
	s << (s jQuery id: #code) html: [:h | self renderPreformattedCodeOn: h].
	s << (JSStream on: 'SyntaxHighlighter.highlight();').
	s << (s jQuery id: #contents) tabs select: 1

I could write a wrapper around the SyntaxHighlighter javascript library, but this works as well :)

So that’s it! Pretty easy exercise  to get an application browser into vastgoodies.

Leave a Comment

JQuery Auto Complete Plugin for Seaside

I have ported a jquery plugin which enabled auto completion on text fields on vastgoodies.com

You can get it here: http://vastgoodies.com/maps/JQuery-plugin%20Autocomplete/BV%202009Oct29

Release notes:

Wrapper for Autocomplete plugin for JQuery.

JQuery Plugin created by Jörn Zaefferer

http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/

Current version: 1.1
Compressed filesize: 8.001 bytes
License: MIT/GPL
Tested in: Firefox 3, IE 6 & 7, Opera 9, Safari 3
Migrated to VAST80 by Bart Veenstra

Autocomplete an input field to enable users quickly finding and selecting some value, leveraging searching and filtering.

By giving an autocompleted field focus or entering something into it, the plugin starts searching for matching entries and displays a list of values to choose from. By entering more characters, the user can filter down the list to better matches.

This can be used to enter previous selected values, eg. for tags, to complete an address, eg. enter a city name and get the zip code, or maybe enter email addresses from an addressbook.

[Usage example]

 |id|
 ( html textInput )
 ;  id: (id := html nextId)
 ;  script: ( html jQuery new script: [ :s |
s << ( s jQuery id: id ) autocomplete 
data: anOrderedCollectionOfStrings] )

[Usage example Ajaxified]

 |id|
 ( html textInput )
 ;  id: (id := html nextId)
 ;  script: ( html jQuery new script: [ :s |
s << ( s jQuery id: id  ) autocomplete 
data: anOrderedCollectionOfStrings ; 
useAjax: true with: s ] )

, , ,

6 Comments

Ubuntu 9.0.4 Performance finally up to par

After using Ubuntu 9.04 for a couple of weeks, i still found it  a bit sluggish. I blamed my intel mobile graphics chip because it is not a really fast performer. But when looking into the CPU stats, i found that I was working at 800 Mhz all the time instead of 2.27Ghz!!!  But even at 800 Mhz, I was not really dissapointed with the performance.

But after some looking around on the Ubuntu forums, I  found out that it has to do something with the CPU scaling. After a few more searches accross the Intertubes, I came accross the following command:

sudo dpkg-reconfigure gnome-applets

After executing this command I added the the CPU Frequency monitor to the top panel and after selecting 2.27GHz as the preferred speed, Ubuntu was flying as fast as I expected to be! Even flash videos work pretty good right now, but still Adobe  need to do some decent programming so it doesn’t use up all my CPU at full screen!!

1 Comment

Exit MOd4J

Seems Mod4J is not yet ready to be used as an production tool because of the many bugs and incomplete features. I can’t even make references between different domain models using the domain model DSL. Because I am used to split up stuff according to thier role and don’t want to end up with a very monolithic model, this is not acceptable at the moment.

also the many open bugs does not give me enough confidence to put more time on this one….

Who knows of any tools which generate most of the plumbing from a domain model?

2 Comments

A weekend with Mod4J

In my spare time, which I have a lot more of because now I work close to home, i am developing an application in which I i will use the Open Social API, OpenID API and other frameworks. Now that my selection of tools and frameworks is pretty much finished, I end up with a rather elaborate domain model which evolves throughout the application development.

So, how to get my design into code quickly… Grails with Gorm would be a good option for that because this would take away much of the plumbing needed.

I tried IntelliJ with the grails framework, but IntelliJ is just a pain in the ass and does not work well with Ubuntu (right mouse context menu’s don’t work for instance) and the whole project setup is way different then I am used to (eclipse junkie). So I reverted back to eclipse and began setting up the framework I am going to use. Read some stuff about using grails with Eclipse but I was scared off by the comments found on the grails eclipse integration.

I read an article in the dutch Java magazine about Mod4J and it seems to fit in my requirements. I wanted a domain model fast with all the persistence thingies and service layer. Mod4J uses some smart easy to learn DSLs (NO DOCUMENTATION!! PLEASE FIX THAT) for modelling the domain in text (i really don’t like those visual tools because they slow you down and typing is much faster).

After some tries on the domain model, I managed to generete a complete application framework from scratch within minutes. All my hibernate mappings, domain objects, dto’s are generated and extensible without intefering with the generation part. I was surprised about the quality of the generated code and for now, i continue to use Mod4J for the development of my application model. So after one weekend Mod4J seems good for me. If it continues to suit me well, i will write some articles on how to setup your environment  and write some examples on the DSL which go further than the examples on their website.

Leave a Comment

Wow! SolrAS already 2nd at dzone.com

A couple of weeks ago I started my very first open source project (still have to figure out what’s the best way to do that, so help me out guys) called SolrAS. Today I submitted a preview to the Google Code site at DZone.

To my suprise my link actually got up to second place! Which is always good for my ego :) and to make things even better, James Ward even upvoted it. Hopefully someone is going to figure out how it works (still have to write documentation).

So, check out SolrAS and tell me what you think!

Leave a Comment

Sneak preview Solr Manager

In the last weeks I have been working on an application for browsing my Solr indexes. I used my open source SolrAS library to access the Solr Index. The only configuration needed is the URL of the Solr server instance. The rest is rendered dynamically by the application.

The Solr manager is far from finished, but the SolrAS Library is pretty solid now. Have a look and tell me what you think!

Leave a Comment

Introduction to Apache Solr

I held a presentration about Apache Solr yesterday trying to convince my collegues to use Apache Solr instead of the search index servers included in Microsoft Sharepoint (i am working on a Sharepoint connector for apache solr, but that is an other item). There is always some healthy tension between de Microsoft puppies and the cool java / ruby / smalltalk / groovy / open source minded developer.

It is what keeps us on edge :)

For those who would like a look at the presentation, you can download it here. It’s in dutch and loosly based on the presentation from Chris Hostetter.

1 Comment

Trying for a third time to start a blog

Hi all,

This is my third time for starting a blog. I seem to always loose interest after a couple of months. Setting up a blog on my own webserver is always fun, but then the spam bots find it and i’ll be busy cleaning out my inbox.

I know that there are some plugins that can keep spam to a minimum, but they need updating as well…And I am very very lazy..

So a different approach on this one. Just standard out of the box Blog, with nothing fancy…Still working on the theme though, so that may change several times until I am happy about it :)

What this blog will be about? Couple of things…just things that keep me occupied such as:

  • Java
  • Smalltalk
  • Flash / Flex
  • User Interfaces (Good and bad ones)
  • Furnature
  • A bunch of other stuff…It’s commons right?

So, hope to see you in my stats!

Regards,

Bart

Leave a Comment

Follow

Get every new post delivered to your Inbox.