New Website!

We have a new website and a new logo for our community. Go Smalltalk!

Smalltalk was designed for Kids!

Yes! Alan Kay was trying to develop an environment to be used in the education of our kids.

Did you Know that Smalltalk was created in 70's at Xerox?

The use of the mouse, the "copy and paste", the bitblt and others technologies was firstly created in Smalltalk. Steve Jobs saw those ideas at Xerox and he developed a new language, Objective-C.

Mailing List in Spanish!

Please, go to http://groups.google.com/group/clubsmalltalk and join us!

Showing posts with label SqueakSource. Show all posts
Showing posts with label SqueakSource. Show all posts

April 26, 2009

The SqueakDBX team has announced the first stable version of the OpenDBX Wrapper

The SqueakDBX team has announced the first stable version of the OpenDBX Wrapper, here is the announcement in the Squeak List: 
After a continuous work since January 08, we are very glad to announce our first stable version of SqueakDBX.
For those who don't know what this is about, the aim of this project is to build an OpenDBX (http://www.linuxnetworks.de/doc/index.php/OpenDBX/) wrapper which will allow users to perform relational database operations (DDL, DML and SQL) through a truly open source library. Through this feature, the squeak community will hopefully be able to interact with major database engines, such as Oracle and SQL Server, besides those which are open source, like PostgreSQL, MySQL or Sqlite. Moreover, by integrating this with GLORP (http://www.glorp.org/), will allow us to generate a complete and open source solution to relational data base access.

Why did we do squeakDBX?

There are several approaches to persistence in Squeak, some very interesting: OODB like Gemstone and magma, image, CouchDB or TokyoT/C, and so on. All of this options get sense if you can actually decide the way you will persist your objects.
However, this is not something that happens very frequently. FREQUENTLY, the client (the one who pays you for making the software) requires you to use a particular persistence strategy (RDBMS). Not only that, but also a database in particular (like Oracle, MS SQL, and so on). They have lots of reasons: they already have license for it, they have support and companies for it, they know SQL, they want to do selects, legacy systems, and so on. But Squeak only provides drivers for MySQL and PostgreSQL natively, so... what would you do in the rest of the cases? move to another language? OK, we don't. We want to program systems in Squeak.
If you know about SqueakDBX you can just see changelog here: http://wiki.squeak.org/squeak/6109; If you don't, you should continue reading ;)
SqueakDBX features:

  • Runs on Squeak and Pharo.
  • Own SqueakDBX plugin (experimental). Ability to easily change the external call strategy (FFI or our own plugin).
  • Support for: Oracle, PostgreSQL, MySQL, MS SQL Server, ODBC and SQLite3
  • Automated database connection ralease (although manual disconnection is recommended ;-)
  • Automated results retrieving in order to do another query, after doing a query and not iterating ALL results 
  • Error handling: Not only errors, but levels associated with an error in order to avoid FFI calls (if you get a fatal error, it has no sense to do another query and the resources must be free). See http://wiki.squeak.org/squeak/6076
  • Very completed documentation in wiki and getting started.
  • Code critics and SwaLint were run several times.
  • Good design (at least all the major refactors demonstrated that).
Full documentation, installation and getting started instructions can be found at wiki page: http://wiki.squeak.org/squeak/6052. We spent a lot of time in it. It has all the information you may need and is in continuos development.
Benchmarks: We have a lot of SqueakDBX benchmarks and also some for native squeak drivers (PostgreSQL and MySQL) and SqueakDBX seems to be faster than both of them. You can read more here: http://wiki.squeak.org/squeak/6063
Packages can be installed from Universe (3.10) or SqueakMap. Current version is 1.0. Sources can be download from SqueakSource http://www.squeaksource.com/SqueakDBX (it requires FFI installed).

OpenDBX version: 1.4.
Remember that you can compile OpenDBX by yourself or use precompiled binaries. For more information please read: http://wiki.squeak.org/squeak/6129.

GLORP integration: Actually, this may include two parts: The integration of GLORP with squeak is completely hardcoded with PostgreSQL native driver. Because of this, first we will do a refactor in GLORP in order to enable it to support different drivers. We will create a PostgreSQL driver with the things that GLORP already has. We invited Alan Night to have dinner with us when he came to Argentina. We told him our ideas and discuss for a while till we got a first design of this refactor. We have already started this part.
Create a SqueakDBX driver for GLORP just like the one we are planning to do for PostgreSQL.

The last squeak port of GLORP is very old and there is nobody to do it. A friend of us, Diogenes Moreira, has accepted this job, so, thanks to him, we hope to have latest GLORP releases in Squeak.
You can see our Glorp progress here: http://wiki.squeak.org/squeak/6132

Help is always wanted. We would really appreciate if you:

Give us opinions, comments, ideas, new features, complaints and so on.
Tell us if you find a bug. Tell us if you test SqueakDBX with other RDMBS or OS different from the ones we tested. Just to know if it works or not :)

If you try SqueakDBX and you write something somewhere like a blog, let us know. We have this link: http://wiki.squeak.org/squeak/6131 where we put useful links for all the people.
Special thanks to:

  • ESUG, for supporting us through Summer of Talk 08; 
  • To Norbert (author of openDBX) for his help and to all the people who tested it and help us.
Cheers,
SqueakDBX team

August 29, 2008

New version of Chalten

It's a new version uploaded to SqueakSource (for Squeak) and to the Cincom Public Repository (for Visualworks) a new release of the project called Chalten 2.0 that is an implementation of the Time Domain (not only of the Gregorian Calendar now).

Here are some examples:

"Create some time entities"
August twentieth, 2008 --> Creates an instance of the gregorian Date for 20/08/2008
August twentieth --> Creates an instance of the gregorian DayOfMonth for 20/08
August, 2008 --> Creates an instance of the gregorian MonthOfYear for August of 2008

"But, not only gregorian entities"
Shaban seventeenth, 1429 --> Creates an instance of the islamic Date for 17/08/1429
Shaban seventeenth --> Creates an instance of the islamic DayOfMonth for 17/08
Shaban, 1429 --> Creates an instance of the islamic MonthOfYear for Shaban of 1429

JulianAugust seventh, 2008 --> Creates an instance of the julian Date for 07/08/2008
JulianAugust seventh --> Creates an instance of the julian DayOfMonth for 07/08
JulianAugust, 2008 --> Creates an instance of the julian MonthOfYear for August of 2008

Av nineteenth, 5768 --> Creates an instance of the hebrew Date for 19/05/2008
Av nineteenth --> Creates an instance of the hebrew DayOfMonth for 19/05
Av, 5768 --> Creates an instance of the hebrew MonthOfYear for Av of 5768

"Converting dates between diferents calendars"
(August twentieth, 2008) asIslamic --> Return Sha'ban 17, 1429
(August twentieth, 2008) asHebrew --> Return Av 19, 5768
(August twentieth, 2008) asJulian --> August 7, 2008 (julian)

(Shaban seventeenth, 1429) asHebrew --> Return Av 19, 5768
(JulianAugust seventh, 2008) asIslamic --> Return Sha'ban 17, 1429
(Av nineteenth, 5768) asGregorian --> August 20, 2008 (gregorian)

"Measuring distances"
August twentieth, 2008 distanceTo: December thirtieth, 2008 --> Return an instance of Measure <132 days>
Shaban seventeenth, 1429 distanceTo: Muharram second, 1430 --> Return an instance of Measure <132 days>
Av nineteenth, 5768 distanceTo: Tevet third, 5769 --> Return an instance of Measure <132 days>

"Also, measuring distance expressed in diferents way (calendars)"
August twentieth, 2008 distanceTo: Tevet third, 5769 --> Return an instance of Measure <132 days>
Shaban seventeenth, 1429 distanceTo: December thirtieth, 2008 --> Return an instance of Measure <132 days>
Av nineteenth, 5768 distanceTo: Muharram second, 1430 --> Return an instance of Measure <132 days>

"Collect some entities"
(ChaltenYear number: 2008 calendar: GregorianCalendar) months
collect: [:monthOfYear | monthOfYear lastDate] --> Returns all the last dates of the 2008 months.
(ChaltenYear number: 2008 calendar: GregorianCalendar) dates select:
[:date | date is: Monday] --> Returns all Mondays of 2008
(ChaltenYear number: 5768 calendar: HebrewCalendar) dates select:
[:date | date is: YomShabbat] --> Returns all yom shabbats of 5768

"Let's create a filter for all dates..."
nonWorkingDays := TimeLineFilter named: 'Non Working Days'

"Now, we want Saturdays to be on that filter"
nonWorkingDays addDayRule: Saturday

"Now we want Sundays from January 1st of year 1000 to the end of time..."
nonWorkingDays
addRule: (nonWorkingDays dayRule: Sunday)
from: (January first, 1000)
to: TheEndOfTime

"Now we want all July 9th since 1816 because is the Independence Day in Argentina".
nonWorkingDays
addRule: (nonWorkingDays dayOfMonthRule: July ninth)
from: (July ninth, 1816)
to: TheEndOfTime

"Testing some dates..."
nonWorkingDays includes: (July ninth, 2008) --> Returns true
nonWorkingDays includes: (July eighth, 2008) --> Returns false
nonWorkingDays includes: (July twelfth, 2008) --> Returns true, it is Saturday

"But, how about to filter some like the hebrew new year day"
nonWorkingDays addDayOfMonthRule: Tishri first
nonWorkingDays includes: (Tishri first, 5769) --> Return true, it is the next hebrew new year
nonWorkingDays includes: (September thirtieth, 2008) --> Return true, it is the next hebrew new year (in gregorian)

"21/08/2008 is a Thursday"
timespan := TimeSpan from: (August twentyfirst, 2008) duration: (48 * TimeUnits hour)
settleDate := RelativeDate timespan: timespan using: nonWorkingDays negated

nonWorkingDays includes: (August twentyfifth, 2008) --> Returns false because 25/08/2008, a Monday, is a working day
settleDate absoluteDate --> Returns 25/08/2008

"Now a new non working day is added to the filter"
nonWorkingDays addDateRule: (August twentyfifth, 2008)
nonWorkingDays includes: (August twentyfifth, 2008) --> Return true.

"Now 25/08/2008, is a not working day"
settleDate absoluteDate --> Now it returns 26/08/2008 because the filter has changed

"Working with time zones"
buenosAiresDateTime := TimeZonedDateTime
dateTime: (DateTime
date: August twentieth, 2008
timeOfDay: (TimeOfDay hours: 19 minutes: 35))
zone: TimeZones buenosAires.

greenwichDateTime := TimeZonedDateTime
dateTime: (DateTime
date: August twentieth, 2008
timeOfDay: (TimeOfDay hours: 22 minutes: 35))
zone: TimeZones greenwich.

buenosAiresDateTime = greenwichDateTime --> Return true, it is the same instant but measure in diferent zone
buenosAiresDateTime distanceTo: greenwichDateTime --> Return a measure <0 days>, because it is the same instant

buenosAiresDateTime := buenosAiresDateTime next: (TimeUnits hour * 3)

buenosAiresDateTime = greenwichDateTime --> Return false, the hour is the same but the zone is different
(buenosAiresDateTime distanceTo: greenwichDateTime)
convertTo: TimeUnits hour --> Return a measure <-3 hours>, just the offset between zones

August 22, 2008

SqueakDBX: beta release for OpenDBX plugin

A team of students from UTN (National Technological University in Argentina) co-ordinated by Estaban Lorenzano has just announced the first beta release of SqueakDBX, a package to allow Squeak to access OpenDBX functionality, so allowing users to perform relational database operations (DDL, DML and SQL) through a truly open source library. OpenDBX can interact with major database engines such as Oracle and MSSQL besides open source databases such as Postgresql and MySQL. SqueakDBX can also integrate with GLORP.
From the release notes, the key features for this release are:
  • Tested on 3.10 and Pharo.
  • Support for Linux and OSX.
  • Proved on windows (through MinGW), but some changes in OpenDBX are still needed (next version will have full compatibility).
  • Tested on PostgreSQL, MySQL and Oracle.
  • MS SQL Server, Firebird, Interbase, SQLite, SQLite3 and Sybase tests will be available as soon as possible.
  • Transactional management.
  • Automatic conversion of resultset columns (a String) into squeak types.
  • Large objects (clob, blob, arrays, and so on) are not yet supported.
  • Special OpenDBX options: multi-statments, compression, paged results.
  • Automated database connection release on garbage collection (although manual disconnection is recommended)
  • Error handling
Some benchmark testing has been carried out, and the performance of the drivers appears to be comparable with native drivers.
The team are very keen to get feedback, bug reports, experiences on different platforms etc, and welcome any contributions. Sources can be download from SqueakSource (it requires FFI installed). Full documentation, installation and getting started instructions can be found at the SqueakDBX wiki page.
This project has been selected as part of ESUG SummerTalk 2008

Information source: http://news.squeak.org.
More information in the track in the ClubSmalltalk Spanish Group