Code Monkey home page Code Monkey logo

scriptaculistpharoheysql's Introduction

ScriptaculistPharoHeySql

Contact List web application that you can use in your web browser. It is served by Smalltalk (Pharo) using the Seaside web framework and persisted to Postgres with ORM HeySql. Uses Scriptaculous for eye candy.

Scriptaculist Demo

SQL setup

You will need to prep your Postgres SQL database with user, password, and db. Here's an example:

psql postgres
CREATE ROLE mycontacts LOGIN CREATEDB  PASSWORD 'mycontacts_pw' ;
CREATE DATABASE mycontacts_db OWNER mycontacts;
quit;

Code loading

Load code like this. Will load all dependencies as well such as Seaside, HeySql, P3, etc.

Metacello new
baseline: 'ScriptaculistPharoHeySql';
repository: 'github://recurve/ScriptaculistPharoHeySql:main/repository';
load.

Initialization

Open up a playground in Pharo and run this:

MyAddressBookSetup init: 'psql://mycontacts:mycontacts_pw@localhost/mycontacts_db'.

Launch your web browser

This is an Address Book where you can add contacts and save to the local database. Use Chrome, Firefox, Safari or your favorite web browser by going to this url: http://localhost:8080/AddressBook

Special Thanks

Petter Egesund - for creating a new way to persist to SQL with Smalltalk called HeySql. For all of Smalltalk's strength, SQL is traditionally its weakness. Most of us prefer to use Object Databases with Smalltalk. Petter crafted an elegant solution that leverages the best features of Smalltalk to make SQL access, shall I say, fun? Yeah, I had a good time. There simply are some times that you need to talk to SQL so give HeySql a try in this AddressBook app. Learn more about HeySql here: https://github.com/pegesund/heysql

Alan (Objcentric) - he created a nice 7 part tutorial for an AddressBook app that is easy to follow and packed with information. I simply decided to mate it with a SQL back end for persistence. If you are new to Smalltalk / Seaside it's worth going through his tutorial and referring to the sample code here to see a few differences in approach. By and large, Alan gave a good blueprint to evaluate Smalltalk in a concise easy to read way. Here's part 1: https://objectcentric.wordpress.com/2007/01/18/scriptacu-list-tutorialpart-2/

Avi Bryant - for daring to put WebObjects behind, learn Squeak, and gift us Seaside for web development.

Disney, Squeak, and Pharo teams for pushing the envelope of what Smalltalk can be in the same way that Linux / FreeBSD opened the world to Unix in an open and welcoming way.

Looking forward

It might be good to fork this AddressBook app then recreate it with different back ends such as GLORP (another SQL option), Voyage (Mongo DB document store), GOODS / Magma / GemStone (Object Databases). That way we can compare how they behave, what it feels like to use them, and maybe develop some best practices.

License and usage

This is MIT-license, use it as you would like.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.