Hi! It’s good news today for a lot of java, ruby and groovy developers – new version “Maia” (officially v9) was just released by JetBrains with a lot of new features (including faster environment, extensive Java 6 support, build-in Google App Engine and Grails projects support etc) – feel read full “What’s new” list.
There exists also not so good news – this time for PHP developers – support of PHP was removed from release of free (”community”) version of IDEA, so developers can stick with other completely free IDEs this time – for example NetBeans comes to my mind this time… as alternative… but after Oracle buy Sun, I not sure it is right choice… but this is “idea” for another post…)
Actually personally I don’t understand why “Community” version does not support PHP, Javascript, Python or Ruby as this languages are used by a lot (if not most) of “open source” developers that for some reasons does not feet into JetBrains licensing of commercial version of IntelliJ IDEA for open source projects. I think “vice versa” if compare to JetBrains – Commercial version must have extended support for Java development, while Community edition must support MORE other open source frameworks / languages, like Ruby, Python or PHP etc. Sure it’s only my “personal” opinion, but I think most of developers will agree with me – people that use IDEA for Java development (usually in enterprises) can (and will!) simply BUY commercial licenses, while a lot of potential IntelliJ users actually want to use it for small open source projects in non-Java languages stack and want to get IDE for FREE!
But totally – all new features show that JetBrains go in right direction – support for most “progressive” and “latest” technologies in IDEA (even if it is available only commercially )
Keep it going, JetBrains!
Today I get a talk with my friend regarding new programming language emerged by Google with “interesting” name “Go”.
Actually we both agree that we don’t see any reason to invent another “low level” / “middle” level compiled programming language… with Nothing NEW inside (see notes at the end of the post)! Just reuse of best practices, but with a LOT of limitations compared with C++ for example (just take a look here for some comparison information – most impressive that Google decide: “Go does not have classes with constructors or destructors. Instead of class methods, a class inheritance hierarchy, and virtual functions, Go provides interfaces, which are discussed in more detail below. Interfaces are also used where C++ uses templates.”… very strange for me… I can agree with C# approach for such details, but seems Google approach is too much!!! I note sure is it really OOP or not if you have only interfaces in hands…. when I do everyday development in C#, at least few times per day I not happy that I don’t have true multiple inheritance, what developers will say about “Go” if they start use it everyday??? )!
Personally I think that if Google want invent some “own” programming language (and only in case if they really want OWN…) they need to take a look into high (or very high) level multi paradigm languages like F# or Scala (or at least on Groovy with his meta programming features for example) and does not invent another “c/c++” or “Python” inspired language !
But what is most interesting and curious is that Google give the name for new language exactly same like another person name his language few years ago! To be more concrete, go to the issue 9 page in google issues tracking page for new language:
Amazing! Just read comments! Ha ha ha! Never see something like this before regarding programming languages! Google took this name and even not “google” for it ! Amazing stupid mistake! Yes, even companies like Google with best and talented people made such stupid mistakes! Actually, I not sure that name “Go” anyway is a good name for such language (and not only me think this way – read comments to issue 9 to get many examples!)…
Even for me, with average (or even low) level of English it looks strange that something that they promote as “fast” have the name “Go” (as we all know most of things that “Go” is slow by default)… Why they not name it “Run” , if they want that this language actually “run” ?! Or like many people suggest “Goo” (from Google) ?
Anyway, it looks really curious……..
Hope this will just “push” Google to develop BETTER OWN language (it MUST be HIGH level or VERY HIGH level language for sure!!!) and probably select for it BETTER name!
Notes: 1) in this post I follow latest definitions for “low level” and “high level” languages… Sure long time ago, “low level” was assembler and C was “high level” language! But currently, it looks like languages like C become really “low level” also! You can check for example following Wikipedia article to get more information). After reading most of information on Go language website, I still not sure can we call this language “Object Oriented” for example… In most areas approach of Google looks minimum “strange”… Except maybe how they implement concurrency… Maybe I just need to try to code something on it to get better understanding?) 2) Please note that I DON’T describe “Go” language as “bad” language. Instead I just put it to “low level” or “middle level” where it looks perfectly! Sure Google will found A LOT of ways how to use this language (and I think maybe already found such ways – for example to embed it in Chrome – read more here) and will “push” usage of this language inside Google and sure outside! And Google really have resources to do this! And some people will probably LIKE new simple but speed language! What I just NOT happy is that this language is NOT really high level language (NO Generics for example, at least by now!). Sure it’s just first release, maybe Google will improve it… but Google likes “minimalism” style, so….. Anyway, let’s just wait a little! Maybe they change language name and Universe!
We will need to use MySQL for Python project for connection from Django Python code to MySQL database. Because I (and hope you also) use Windows 7 64 bit with Python 64 bit, needs to found and install 64 bit version of such library. On original project site, for some reason I could not found (at least in the moment when I write post), so I get it from different site: http://www.codegood.com/download/3/. Just download and install it (it will automatically found your Python installation if you follow all steps that I write in previous posts).
Let’s configure now, EvejobDJ project to use MySQL database.
First, needs to create “EvejobDJ” database schema using one of the administration tools, for example, described in Part #7 – just create it visually or issue following SQL command:
CREATE DATABASE EvejobDJ;
Open “settings.py” file in root folder of EvejobDJ project inside IntelliJ IDEA IDE and change database engine parameters to following:
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'evejobdj' # Or path to database file if using sqlite3. DATABASE_USER = 'root' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
Now it is time to test connection and create default tables in database (for authentication, sessions etc):
cd C:\Evejob\EvejobDJ python manage.py syncdb
Hopefully you will get something like this in response:
As you see you will need to create default “superuser” (I just put “admin” as his username and “info at evejob.com” as his email) because Django authentication app enabled by default.
Now you can check in MySQL database administration tool that you really create tables (screenshot from free MySQL Administrator that you probably install with MySQL GUI Tools):
To use MySQL in Ruby On Rails (RoR) we need to install MySQL Adapter, for example:
ruby -S gem install mysql
But here we get into trouble – binaries of this gem (mysql) does not work correctly on Windows 64 bit and on project site there is no version for 64 bit OS… While on some “Unix” OS it is possible to fix this issue (for example build gem from source…), on Windows it is simply not possible… Ah, OK, OK… it is possible, but just too complex / time consuming – don’t want to spend time on this NOW and leave this time to focus on coding of Evejob… maybe somebody or author of gem will fix this issue later!
Note: other available adapters for MySQL from Ruby seems also have same problems… at least by now.
So let’s just temporary switch to PostgreSQL for Ruby on Rails version of Evejob.
To setup PostgreSQL for EvejobRoR development it takes just few minutes:
development: adapter: postgresql encoding: utf8 reconnect: false database: EvejobRoR_development pool: 5 username: postgres password: admin host: localhost test: adapter: postgresql encoding: utf8 reconnect: false database: EvejobRoR_test pool: 5 username: postgres password: admin host: localhost production: adapter: postgresql encoding: utf8 reconnect: false database: EvejobRoR_production pool: 5 username: postgres password: admin host: localhost
ruby -S gem install postgres-pr
This will install PostgreSQL adapter for Ruby (gem “postgres-pr” works on Windows x64)
Now you can try to execute database “migration” that will hopefully create some stuff in development database:
cd c:\Evejob\EvejobRoR c:\ruby\bin\rake db:migrate
It will be to simple if this will work for you from first attempt! On my machine, I was need to made small “hack” to made this work, i.e. to add following code into new_rails_defaults.rb file in “config\initializers” folder and run db:migrate again:
def PGconn.quote_ident(name) %("#{name}") end
(look for more info about this “hack” here)
If you complete everything, you can check that db:migrate actually create one table (”schema_migrations”) in your development database:
Let’s configure last version of Evejob which going to use MySQL database – EvejobGoG.
First, needs to create “evejobGoG_development”, “evejobGoG_test” and “evejobGoG_production” empty databases. You can do this trivial task using MySQL Administrator GUI Tool for example.
Next step is to let know Grails how to connect to just created MySQL databases. Because Grails runs on Groovy and Groovy itself runs in JVM we can use MySQL Connector/J from MySQL site: http://dev.mysql.com/downloads/connector/j/
Download “zip” file, unpack it to temporary folder and copy mysql-connector-java-x.x.xx-bin.jar file to the C:\evejob\EvejobGoG\lib folder.
Now open EvejobGoG project in IntelliJ IDEA and found DataSource.groovy file located in “EvejobGoG\Grails-app\conf” folder. Let’s change some settings in this file:
dataSource { pooled = true driverClassName = "com.mysql.jdbc.Driver" //"org.hsqldb.jdbcDriver" username = "root" password = "" dialect = "org.hibernate.dialect.MySQL5InnoDBDialect" } hibernate { cache.use_second_level_cache=true cache.use_query_cache=true cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider' } // environment specific settings environments { development { dataSource { dbCreate = "update" // one of 'create', 'create-drop','update' url = "jdbc:mysql://localhost/evejobGoG_development" // "jdbc:hsqldb:mem:devDB" } } test { dataSource { dbCreate = "update" url = "jdbc:mysql://localhost/evejobGoG_test" // "jdbc:hsqldb:mem:testDb" } } production { dataSource { dbCreate = "update" url = "jdbc:mysql://localhost/evejobGoG_production" // "jdbc:hsqldb:file:prodDb;shutdown=true" } } }
Now Grails know how to connect to MySQL. Unfortunately, there is no build-in database migrations functionality in Grails framework yet, so our next step is to install some plug-ins that can help us to maintain database schema versions and migrations. While exists few of such plug-ins, I think most “featured” is LiquiBase (but also you can take a look into “Autobase” if you prefer to dial with DSL instead of XML… just take a note that this plugin works only with Grails, while LiquiBase can be used with Ant, Maven, Spring etc or even independently as database change management solution)
To install LiquiBase do following (you can read more regarding Grails integration with LiquidBase here):
cd C:\evejob\EvejobGoG grails install-plugin liquibase
Now check that you have following folder (that is empty by now):
C:\evejob\EvejobGoG\grails-app\migrations
If you don’t have folder yet, just create it before continue with migrations – this folder will be used to save migrations change log etc..
Now it’s time to generate change log and migrate database (that is empty for now) to initial version:
grails generate-changelog grails-app\migrations\changelog.xml grails migrate
After first command (”generate-changelog”) LiquiBase will create initial version of database change log and save it to the “C:\evejob\EvejobGoG\grails-app\migrations\changelog.xml” file. It will looks something like following:
Second command (”grails migrate”) will actually made migration in database. In our case because our domain is empty, LiquiBase will just create changes maintenance tables: “databasechangelog” and “databasechangeloglock”. You can check now this using MySQL Administrator:
If all steps above completed successfully you finish setup EvejobGoG Grails project to use MySQL Database and have ability to migrate databases!
Grails Installation
To install Grails follow steps:
1) Download and install JDK from http://java.sun.com/javase/downloads. Make sure that you use following version
Note: You don’t need Bundles packages. Also make sure that you download Windows x64 version of JDK, like on screenshot bellow:
Let’s assume that you download and install JDK to following default location: C:\Program Files\Java\jdk1.6.0_16
2) Download latest stable Grails Binary ZIP Release from http://www.grails.org/Download, for example: grails-bin-1.1.1.zip. We not going to install Grails from sources (build it) due to the fact that Grails support “grails update” command, which can update your Grails version to latest one.
3) Extract Grails archive to the following folder: C:\Grails
4) Create JAVA_HOME environment variable that points to the path where you have installed JDK and create a GRAILS_HOME environment variable that points to the C:\Grails folder:
Note, make sure you enter your system path to JDK and JDK version that you install before.
5) Append %GRAILS_HOME%\bin to the PATH variable:
6) Check that Grails installed successfully - just type “Grails” in command prompt and check that you get a help message like:
OK, installation of Grails finishes here, let’s move to the next task…
EvejobGoG and EvejobGoGG projects configuration
So let’s start to create EvejobGoG project that is build on Grails and EvejobGoGG also build on Grails but specially adjusted to be hosted by Google App Engine.
First Start IntelliJ IDEA, open “Create New Project”, select “Grails Application” and enter project files location as “C:\evejob\EvejobGoG”:
Press Next and on Grails SDK window, press “New” to add new one and in “Select Path” window select “C:\Grails” folder (where you install Grails before):
You will get something like this (your version of Grails can be different):
Press “Next” and on next window (Select the desired technologies) leave all options unselected. After you press “Finish” you will get new Grails project opened in IDEA (if during this phrase IDEA will ask you about some updates in Grails Tool Window, press “y” to do so):
Now you can repeat same steps to create EvejobGoGG project that will use Google App Engine.
But first let’s install Google App Engine SDK for Java.
Go to the http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Java and download Zip file that contains SDK (usually file have name like “appengine-java-sdk-1.2.6.zip”). Than create folder C:\Google\google_appengine_java_sdk and unzip archive content to this folder. That’s it – Google App Engine Java SDK installed.
Let’s setup environment variable which is used by Grails plugin to locate App Engine Java SDK – APPENGINE_HOME (in our system we install it to C:\Google\google_appengine_java_sdk folder):
Let’s reload IDEA so environment changes takes effect (we will use APPENGINE_HOME variable in a second).
Now let’s continue with IDEA and setup EvejobGoGG project same way like we create and setup EvejobGoG (all step exactly same like above).
IntelliJ Idea provide great support of Grails development build-in. For example it is very simple to install Grails Plug-ins directly from IDE (make sure that you select EvejobGoGG project in IDEA window):
Ones you open Grails plugins window, probably you will need to press “Reload Grails Plugin” button, to get a full list of available plugins:
Type “app” in search box and select “app-engine” plugin (”Grails AppEngine plugin”). Check check box “Enable” and press “Apply Changes”. Than select latest release version of the plugin, for example:
OK, let’s back to plugin installation – press “OK” on plugin installation window and in Grails window you will probably get question “Do you want to use JPA or JDO for persistence”. Let’s for now just answer “jpa” and finish plugin installation.
Finished… Ah, ups… Let’s just check that project structure is OK – go to “File / Project Structure” window:
Sometimes (looks like due to some bug in IDEA currently???) you will not get Project SDK configured:
If you in this situation (hopefully not, but just in case), press “New” button, select “JSDK” in drop down and browse to your JDK path:
After, press “Apply” and you will add JDK to EvejobGoGG project.
Do the same check (and probably fix) for EvejobGoG project.
“Evejob” is a Web 2.0 style Social Job Board Open Source web application developed in few frameworks / programming languages simultaneously and released under GPLv2 license.
Why another job board application?
First – every developer understand naturally such business domain because at least one time in his live he was a “Job Seeker” and some day probably also become (will or already) an “Employer”. So I (and readers) will not spend time to learn business domain in developing Job Board application! (sometimes really huge amount of time team or independent developer just learn business domain of application… It’s actually wrong to think about this as “time waste” because as much developers understand the business as more better software they usually made!).
Another reason why I decide to create another job board open source application(s) is absence of such project developed in true MVC architecture (at least by now). Try to search open source Job Board software? You will found huge amount of poorly written PHP scripts (most are not open source) and for sure you will not found any good ASP.NET MVC or Ruby on Rails implementations… Social Job Board software have a huge “potential” and I don’t want to lost opportunity to develop good open source version of such application (and even more – first few versions powered by different platforms!).
Last reason which I want to list here (in reality I have much more reasons for sure), is that I have some cool ideas how to make really SOCIAL Job Board and want to at least try such ideas on practice!
Evejob Application Versions
So, there will be few major versions of Evejob applications:
All versions will be developed and updated in parallel with comparisons between frameworks / languages features, platforms and even IDEs in the way …
Why I will release project as Open Source? Sure primary reason because I want other developers will get benefits from it, like I now get benefits from all open source software that I use every day. Another reason – I want to made this application better, so I need feedback, and not only from end users, but also from other developers! In my case, because I get used few different programming languages, I will probably get really huge feedback – at least few times more then if i will write code using one language! I will get feedback from developers with different cultures (Unix vs Windows environment), different preferable coding styles (dynamic language or static) etc… Think project will benefit from this (and actually I never see something like this before so it will be at least interesting to get a try … ) !
Agile Development
As you probably understand by now, I am a huge fun of Agile development (and even Agile life).
What this means for selected project:
Integrated Development Environments
One thing where I really don’t want to go most simple way is usage of Integrated Development Environments (IDEs) … While all development can be done using even simple text editors (notepad, vim, Emacs etc) I decide to implement this project using rich IDEs available for selected platforms.
Reason – most of developers DO use IDE at work (companies simply buy it) and I think this will help developers to make total compare of PLATFORMS, not just frameworks or programming languages. While a lot of people can argue that IDE does not make any difference (and probably they are right in some cases), I think usage of IDE can significantly decrease developing time ones you get use of functionality they have and sometimes even improve discipline (with tools like ReSharper for C# for example) of developers.
So here is the list of IDEs I am going to use:
Why I choose IntelliJ IDEA, but not Eclipse or Netbeans (really good free alternative to IDEA) or Wing or Komodo etc? For .NET development, Visual Studio is STANDARD and Express Edition that available for free simply “for users other than professional software developers, such as hobbyists and students.” (but even so Express Edition should also work for you). Because my goal is to be at least “professional software developers” (and readers I think also) I must use at least Standard version of Visual Studio that is not free (except cases when Microsoft give it for free for start-ups etc, like on http://www.microsoft.com/bizspark/ for example)… So to make fair comparison I must use something not free for other versions also… This means that great tools like Netbeans or Eclipse simple can’t be used in this case (as both are completely free). Sure if you going to made your own projects you can use Netbeans or Eclipse because both have good support for both Ruby on Rails and Grails development and even Django (with some additional external tools / plugins). Regarding Komodo / Wing etc, they are too specific for selected languages or does not support all frameworks I need (at least by now). While it is available free IntelliJ IDEA version for open source developing, because I (and readers) some day going to make a money, it’s make sense to compare versions for commercial development.
Application Hosting
Hosting… Yes, while I can leave this decision for later in theory, in practice it can (and will) effect our architecture… So let’s made it clear now: I am going to host Grails, Django and Ruby On Rails versions of Evejob application in Google AppEngine. Google AppEngine support Python natively so we can run Django here. Also last version of AppEngine support Java as programming language. So because Grails leverages Groovy (which written on Java), we can also run Grails applications in AppEngine. Same for Ruby On Rails – it is available JRuby implementation of Ruby on Java so we can run Ruby On Rails applications in Google App Engine. To host ASP.NET MVC application in I am going to use latest Microsoft Azure platform.
Operation System
I am going to make all development under Microsoft Windows 7 64 bit Operation System (OS). Visual Studio 2008 does not work on any other non-Windows operation system directly (and I don’t want to use virtualization for such case – IDE must work on operation system for which it was written to get maximum performance… but, while IDEA works on almost any OS, Visual Studio does not!). Even so, It is still exists option to use Mono (cross platform Open Source development framework) to run ASP.NET MVC on other OS except Windows, and to use MonoDevelop instead of Visual Studio for example. Unfortunately I decide to port application to Mono AFTER development will be completed. (primary because I just want to wait until Microsoft legally allow to use Mono or finally will just “close” it, so I will not need to release another version for this wonderful framework).
Project sources, links and documentation