Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Wednesday, July 9, 2008

Be careful when developing on Windows but hosting on Linux

I know this is kind of old and obvious but any way I had the problem with paths that are not case sensitive on Windows but case sensitive on Linux. I hit this problem while I used grails controller with the name LearningCenterController and had my gsp pages in folder named learningcenter.

Simple code from controller like this one:

def index = {
render (view:'about')
}

worked fine on Windows. Then I deployed changes to my VPS hosting provider and there I had a problem with error reported: file not exists. And of course, this happened because folder names are case sensitive on Linux.

So nothing special but only good well known story: be careful when developing on Windows but deploying on Linux.

And by the way did you already visited grails tutorials? ;)

Tuesday, May 13, 2008

Why is it so Easy to Work with Grails

Last few days I am working on grailstutorials and this is the first time that I am doing some bigger project than experimenting with Grails. While so far I had that feeling now it is even more clear to me while development with Grails is so easy and fast. I will try to share my understanding how high efficiency is achieved when working with grails. Let us see what more or less common web application requires to be implemented: (This list is not full list and I can add number of points into this list)
  • front end for end users
  • front end for administrators and other special users
  • Easy creation of templates and tag libraries
  • business logic persisted to database
  • security
  • searching
  • (java back end - this can be discussable)

Let see each of these points.

Front End for End Users

Regarding front end for end users different requirements may be important. Maybe you want fancy front end with lot of Ajax. If this is the case you have different plugins available like (GWT, Flex). This means you can easily integrate advance Ajax concepts into front end. If you need only simple Ajax you can achieve this with the core grails functionality. You may want to have a look on one of my previous posts Grails and Simple Ajax. At the final end, as with all frameworks to have really nice user interface you have to work hardly and cannot achieve this in minutes. With Grails it may be faster but need not. But the real velocity comes with further features.

Front End for Administrators

Creation of front end for administrators is mainly out of the box. Just try to think what are administrators responsibilities. They have to create something (usually business objects), they have to approve something - usually on business objects, they need to have overview of the system status - usually on business objects. Mainly they do not need fancy user interface. No fancy user interface means that you can use one of the grails out of the box features - scaffolding. For each domain object grails can for you generate CRUD screens. For administrators to be able to work with these screens minor if any updates are necessary.

Easy Creation of Templates and Tag Libraries

With Grails creation of templates and tags is so easy that very soon you will realize that all gsp files are created from templates and tags. Code that influence readability of gsp files, at least for me, are conditions, loops and similar programmatic constructs. All these constructs are easily replaceable with template or tags. Actually, when I create template, I immediately create tag for that template and after that work only with tag. To see example of template and tag lib you may want to have a look at my post about templates and tag.

Business Logic Persisted to Database

Here comes full power of the Grails. Just create domain object and database tables are generated for you. Even database is automatically updated when you update domain objects. For each domain object or relationship between domain objects you can create basic CRUD screens. Learning how to work with domain objects does not take a long time and if you have experience with Hibernate it can take you less than a day.

Security

Generated front end for administrators and working with domain object on the low level will be useless if there is no security for application. For sure in the most of the cases we cannot allow end users to see domain objects in CRUD screens. It means we have to secure CRUD screens. This is actually not a problem. There are security plugins for grails. I have used acegi security plugin. It will generate all necessary classes and screens for you. All you need to do is to specify what is visible by which role. And this configuration is really very simple. So in matter of minutes you integrate security into application. I am not sure about advance features as I didn't have used them but probably it should not be complex either. How much time it usually takes you to secure web applications developed with other technologies?

Searching

These days searching is popular. And of course it is useful. All data on you web site will be useless if users cannot find them. Grails has solution for this too. You can use Searchable plugin. You add line of the code to the domain class(es) and out of the box you have searching integrated into your application.

Java

I must agree that this is really discussable if we need Java or no. But in the case you want to have backend implemented with Java, important thing is that Java is integrated with Grails applications seamlessly.

I have just made short overview of features that was most useful for me so far while working on grails application. Features mentioned are not full set as grails frameworks contains lot of other important capabilities. Just to mention few of them: easy unit, functional and integration testing, excellent plugin system, work with XML, web services...

What about your experience with Grails?

Monday, January 21, 2008

grails excellent web framework

For long time I had kind of resistance to have a look at some "new" and exciting scripting languages like groovy or ruby. For some unknown reasons, few days ago I decided to take a very short look at a groovy. I read documentation, examples and I liked it. But that would not be enough to invest some time to learn it. But then I noticed link to grails, web framework so far unknown for me. As for past months I am deeply within web development I decided to read a little bit about it.

I have downloaded grails, opened tutorial and had hello world example in 60 secs. I couldn't believe it. With JSF combined with Facelets, RichFaces, MyFaces (what is advisable as technology stack) for hello world you need hours of configuration. Sometimes even when you use RAD tools like Red Hat Developer Studio.

This increased my courage and I continued reading some advance tutorials. Tutorial is nice and it seemed to easy to be true. So I gave it a try. I downloaded the book from infoQ and followed instructions from the book (the whole book). I didn't use tutorial because I wanted to try much wider approach than one covered in tutorial. Everything worked smoothly. For me this is excellent discovery. After using JSF and lot of surrounding technologies, I got framework with which it is really easy to create web applications. So far it seems that with grails web application development is as it should be: easy and fun.

I am sure I will continue to investigate grails and as I have some decision possibilities I hope that maybe we will do some commercial project with it.

My advice:
If you didn't try grails yet, try it right now, you will be pleasantly surprised.