. .

st4u

ST 4U 243: Extending a Class in VA Smalltalk

June 8, 2012 10:34:25.425

Today's Smalltalk 4 You shows you how to extend an existing class in VA Smalltalk without changing the owning Application. In VA/Envy, all classes are owned by an Application. If you change the class definition or an existing method, you have to change the owning Application. Today we'll look at adding new methods to existing classes in your own Application. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Extensions.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Today we'll look at how to extend existing classes in VA Smalltalk - organizing that code into your own Application/SubApplication instead of in the owning one. We've created a new Application and class, and a single method: #isFoo:

Example

If you imagine this method as the kind of test that will be used to find out whether a given object is a "foo sort of thing" or not, then you see that we want a matching method like this:


isFoo
    ^false

In Object. However, we don't want to add that method to the Application that owns Object. Recall that in ENVY, class definitions are owned by the Application they are defined in. If you need to change and existing method or class definition, you have to create a new version of that Application. However, that's not the case if you merely want to add a new method

In your Application, select the "Classes" menu. Pull down to "Add", and you'll see "Extension" as a possibility. That's what we'll do here:

Extension

You'll then get prompted for the class you want to extend:

Extension

Finally, add the method in the browser - you've now extended a class owned by a different Application in your own Application:

Extension

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u243-iPhone.m4v ( Size: 2600760 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 242: Applications and Subapplications in VA Smalltalk

June 6, 2012 9:33:19.007

Today's Smalltalk 4 You looks at the standard development process using VA Smalltalk and ENVY. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

SubApps.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Today we'll take a look at Applications and Subapplications in VA Smalltalk. In most circumstances, you can just build configuration maps from "flat" sets of Applications, but there are times that you might want to create sub applications. The most common example is one that exists in the system as shipped by Instantiations - platform specific code:

SubApp

What we are looking at is on Application - CommonFileSystem - and asset of sub applications. Some of them load regardless of the platform you are on, while others are specific to the platform you are on (Windows, Linux, Unix). Take a look at Application definition in ENVY:

App Definition

What we have here is a set of apps for all platforms with configuration expressions that specify which ones actually load. The Subapplications are hierarchically organized under the main Application, but can be set up to load only when it's appropriate.

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u242-iPhone.m4v ( Size: 3907373 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 241: Spotlight Style Searching in Pharo

June 4, 2012 8:22:20.258

Today's Smalltalk 4 You looks at the new Spotlight style search in Pharo. This is in Pharo 2.0, which is not released yet - so be aware that you may run into some rough edges with it. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Search

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:

Technorati Tags: , ,

Enclosures:
[st4u241-iPhone.m4v ( Size: 1729441 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 240: Making External API Calls

June 1, 2012 11:01:28.736

Today's Smalltalk 4 You looks at making external API calls using VA Smalltalk. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

External Calls.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Today we'll take a look at how to make external API calls from VA Smalltalk. IN this example, we'll call the MessageBoxA API in Windows:

C API

The code looks like this:


| pf |
pf := PlatformFunction fromArray: #('C' 'MessageBoxA' nil 'user32.dll' #(#uint32 #pointer #pointer #uint32) #int32).
pf 
   callWith: PlatformGlobals::HwndNull 
   with: 'this is some text' asPSZ 
   with: 'this is a caption' asPSZ 
   with: PlatformConstants::MbYesno

To understand what's going on in the ByteArray of arguments, have a look at class PlatformFunction:

PlatformFunction

Bear in mind that this example is a bit artificial; the class CwPrompter exists in VA< and uses this API already. However, it does give you a simple example of making an API call, and you can follow the same pattern for your own work.

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u240-iPhone.m4v ( Size: 3344361 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 239: Finding Open Editions

May 30, 2012 9:26:37.028

Today's Smalltalk 4 You looks at open editions in VA Smalltalk (using ENVY) - specifically, how to figure out which classes you have open (in which applications) at any given time. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Open Editions.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


If you follow the recommended development process using VA Smalltalk and ENVY (detailed here), you'll need to track down and release your open class editions on a regular basis. If you're working in one or two applications, that's pretty easy - but what if you have a lot of them? There's some query support in VA Smalltalk that makes this easy. Go to the Tools menu in the launcher, and pull it right at Query:

Query

Results for each query are displayed in the Transcript, rather than in a pop up window. For instance, say you need to know about the open class editions:

Open Editions

You can execute a number of other queries from this menu - they all report to the Transcript

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u239-iPhone.m4v ( Size: 2769485 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 238: Finding Text In Any Method in Pharo

May 28, 2012 11:38:15.880

Today's Smalltalk 4 You looks at finding string matches across any source code in Pharo. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Search

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:

Technorati Tags: , ,

Enclosures:
[st4u238-iPhone.m4v ( Size: 2054005 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 237: VA Assist Pro Settings

May 25, 2012 10:07:18.084

Today's Smalltalk 4 You looks at the saving and restoring your VA Assist Pro Settings. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

VA Assist Pro.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Last time we looked at the plethora of settings available for VA Assist Pro, all of which can customize your experience with VA Smalltalk. Today we'll look at how you save those settings so that you can restore them in a new image.

To save those settings, pull the menu for VA Assist right through Save/Restore, as shows below:

VA Assist Pro

Note that you can save the settings either to flat files or the ENVY repository. Either way works fine, and integrates well with a build process. Follow the same pull rights to restore the settings in a new image:

VA Assist Pro

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u237-iPhone.m4v ( Size: 2109564 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 236: VA Assist Pro

May 23, 2012 8:18:59.707

Today's Smalltalk 4 You looks at some of the options you have with VA Assist Pro. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

VA Assist.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Today we'll take a look at the various configuration options that are available for VA Smalltalk through the VA Assist Pro interface. To start, go to the Tools menu in the launcher:

VA Assist Pro

The setup tool presents a tabbed interface of the options - and there are a lot of them. You can configure the editor, color syntax highlighting, and a ton of other things:

VA Assist Pro

It turns out that you have other options as well - go back to the launcher's Tools, and find Settings in the VA Assist Pro submenu:

Settings

As with the options in the previous interface, there's a lot here - you should step through them and experiment.

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u236-iPhone.m4v ( Size: 4416809 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 235: Config Maps and the Development Process

May 21, 2012 0:56:40.137

Today's Smalltalk 4 You looks at the standard development process using VA Smalltalk and ENVY. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Development in VA.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Today we'll take a look at the normal development process in VA Smalltalk using ENVY. The general pattern works as follows:

  • Create a Configuration Map
  • Create your Application(s) and add them to your configuration map
  • Create your classes and extensions with your application(s), versioning and releasing the classes as you develop them
  • Leave the Application(s) and Config Map "open", only versioning them as you reach development checkpoints
  • As you begin work each day, load the latest open edition of the config map

To start, create the config map:

Config Maps

Now create the Applications you need, and write code inside of them:

Code

Version and release the classes in your Applications, leaving the Applications "open":

Code Release

Make sure you add all of your Applications to the config map, in the correct order for loading. Also specify the necessary pre-reqs. If you mess this up (i.e., the map won't load), don't worry - you can edit the config map details without having it loaded:

Config Maps

Now, as you begin each working day, load the latest open edition of the config map, with all developers working within the open edition:

Load Config Map

You only need to version and release the Applications and Config Map as you reach checkpoints. When and how you reach them will depend on your process, of course - but the process we've sketched here is the one you'll want to follow.

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u235-iPhone.m4v ( Size: 8328768 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 234: ENVY Config Maps

May 18, 2012 7:02:22.578

Today's Smalltalk 4 You looks at the ENVY config map browser - what each part shows, and how you would use the various aspects. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Config Maps.

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Today we'll take a brief tour of the Configuration Map browser in VA Smalltalk. For any VA project, it's a tool you'll get very familiar with; it's where you set up all of the loading information for your project. Take a look at the screen capture below:

Config Maps

The list on the left is all of the defined maps in the library. Since your image must be connected to a library to work, this list will grow over time. There are two panes to the right, labeled "Editions and Versions", and "Applications". Any map has a number of versions (anything not versioned will be an open edition - we'll discuss those soon). The list of Applications tells us which Applications make up the config map, and what the load order for them is.

The lower left pane, "Config Expressions" requires some explanation. Generally, you leave this blank, or put in the simple statement "true". However, any Smalltalk expression that answers a boolean could go here. Say you wanted to define a Config Map that should only load on Unix/Linux systems; you might want something like this:


(System respondsTo: #subsystemType:) 
    and: [(System subsystemType: 'CFS') = 'POSIX']

The next pane to the right contains a listing (in order) of any pre-requisite maps - those that need to load before your map can be loaded. One of the nicer things about Envy is that you can edit all of this information without actually loading the map; if you make a mistake that prevents the map from loading, you can some back here and address it.

The last pane on the bottom is for comments - it's often used for license information, or copyright notices. It's free form, and can contain any information you feel is relevant.

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u234-iPhone.m4v ( Size: 4042512 )]

posted by James Robertson

 Share Tweet This

Previous Next (554 total)