Pages

Saturday, May 8, 2010

Role oriented vs Class oriented

The difference of programming paradigm between Go and other object oriented(class based) language may be well described by an analogy of  a modern role based society  and old class based society.

In the latter society, people will not change the role in society , it is determined by the birth[instance creation], while role based modern society, people can take any social role depends on his ability(in ideal society though)[implementing interface]. Also if he is bored of certain role, he can changed it. Also he may have several roles while early development stage, then eventually, he can delegate those roles to others.

In a programming in Go, we will develop certain functionality in this way.
The difficultly in class based object oriented language was probably it was not oriented toward the individual [object], but the class  itself. The separation of role[interface] from the birth[representation] make things more flexible.

Web apps with Go

In order to develop Web application, some API to access database is important.
This recent project looks useful.

http://github.com/Philio/GoMySQL

Also recent Go tutorial is useful for web application.

http://golang.org/doc/codelab/wiki/