30
Jul 09

Choosing a web development framework/toolkit

I’m sure I’m not the only lunatic that spends many hours well into the night thinking about web frameworks, but then again, maybe I am. This is all exacerbated by the fact that I work for startups, so requirements are much different that say someone working for an established corporation that has various standards and practices in place. I left the corporate world 4 years ago and haven’t looked back. I love the dynamics of the startup environments and my personality fits very well with its culture and pace.

So some of the questions I battle with are, which framework should I use for this new project, or am I using the right framework for my current project? Is the framework and language it’s written in supports writing applications in a powerful, flexible, fast, scalable way? A lot of the criteria I just listed are not as much framework as design and architecture of your applications and infrastructure, but frameworks can make it easier or harder to achieve such a desirable architecture.

The issue is not as pronounced for other non-web applications, mostly due to the fact that most Turing-complete languages are capable of performing the same job as any other, the only question is the programmers preference, proficiency, and the availability of some framework/abstraction to make your life a bit easier. In some languages, writing these abstractions is a breeze or in some instances they are not explicitly available because some or lost of boilerplate is reduced through various language idioms.

But web development is so complex these days, that simple abstractions are not enough. Anyone that thinks either hasn’t created a serious web application or posses some information that I’d be willing to pay to have:-) Sure, with the knowledge of HTTP and some gateway protocol, whether its CGI, Java Servlets, WSGI, etc…, one can do almost anything that’s possible on the web, but that’s a pretty bad criteria to have in the age of ever so complex applications/features. One doesn’t want to rewrite something from scratch. Authentications/Authorization for example, although many applications have a pretty custom authn/authz scheme, 80%+ of what’s needed is boilerplate that I nor any experienced application developer cares to reinvent. I’d rather be doing more challenging things, not sure about you.

So many frameworks conceal some amount of boilerplate from the developer through abstractions. Right now, there seems to be two kinds of web framework camp schools of thought:

  1. I’ve done this many times before, trust me, you don’t need anything else. I’ve extracted this, not made this up. The 20 applications that I’ve developed with this framework and extracted all of its generic concepts is all you’ll ever need. Here is my convention down your throat. You think you need XYZ? No dumb ass, you just have no clue and your brain has all the baggage of a previous framework. Come on, open your mind, do you really need XYZ? You do? Well #$%@ you, go use someone else’s framework.

  2. We don’t know what the developer wants, he might want bar or foo or barfoo or foobar or foobarbarfoobarbar, or what ever they wake up and desire that day. We’ll come up with abstractions that can be extended by other abstractions. But wait, what if the developer wants to extend those other abstractions, oh, well we must allow them to do so, so here are some more abstractions. Before you get started, here are 50 different things you must do, with xml or code bootstrapping.

The second camps sound nicer, more sane in some instances, and you’re overwhelmed with the flexibility that makes you believe that nothing is impossible. But that’s further from the truth.

I’ve mostly used the #2 frameworks, as with many years of development, I’ve developed quite a convention of my own. No, it’s not that I’m not open minded old timer that is scared of change, actually I love change so much that I find spending many unproductive nights hacking something in a completely different language/frameworks, exploring the ever so unpopular technologies, etc… But my conventions have grown empirically, though I’m not easily swayed to go back 10 years ago when I had no experience and relearn from the same mistakes I’ve already made to just come to most likely the same conclusions. People do this all the time, in every field and I don’t have grant money nor a big corporation blindly investing in my useless use of time.

I’m pretty big on DDD and OO and all the abstractions that come with it and I need a framework that allows me to do so, without forcing me to mix relational and OO concepts by forcing me to use a weak ORM, or no ORM, or an ORM that they choose for me. I also am more than capable of deciding whether I need a Repository data layer and not just a plain simple DAO layer. I know what I’m talking about, at least I think I do, so I don’t need any 20 year old telling me that using recordsets that masquerade as domain objects is just fine. Maybe for you, but I have a different opinion. It’s possible that your todo list will do just fine, but not my software that might start off with 10 domain objects concepts and grow larger as functionality is added. Ok, enough with my discontent with the 20 year old programmers, there are many of them that are brilliant, they’ll just have to learn (or not) as the time goes on.

Now with all that’s mentioned above, I also am very aware of over-engineering and aren’t we all so good at it. So, when I’m not in the mood to over-engineer something, I’d like a simple way of accomplishing a task. Without all the enterprise application pattern abstractions, etc… Sometimes I just want to create a quick prototype, start off simple, then grow it if needed into a production ready piece of software. Eventually through constant refactoring, I’ll add the necessary patterns/abstractions as my requirements grow or change.

With all the above rant, I’m yet to find a framework that can do this. Rails maybe comes close, only one problem. ActiveRecord is very limited and sucks. Besides the mapping limitations, you also bind your domain objects to the relational model and are constrained into modeling your domain in a unnatural way. This might be fine if you’re building a small app in its isolation, but it’s a huge technical debt if you’re building a service model on top of a persistence model that might be used/reused by other domains or services, etc… I want to have a consistent, coherent domain which is available as a service to other services, like webapps, background processes, etc… Good luck doing this with Rails. It is true that when I’m first starting my app this might not be a requirement, but like any other startup company, we have a vision and if that vision is realized, we’d rather not have that much technical debt to pay before we can move forward.

So after all the rant above, what is it that I want? Here is a list. It’s not comprehensive, just things I can think of at this time. I’ll update it as I think of anything else.

  1. Support for MVC (most frameworks have pretty decent support for that now)
  2. Extensible MVC (need to be able to extend the way controllers and views operate. Some frameworks do it by convention and limit you to a set of popular conventions.)
  3. Allows you to build your domain in isolation. (I want my domain model to be completely decoupled from any web technologies, persistence, etc… Just a plain OO domain model)
  4. Gives you very flexible persistence options. (I might decide to use a fully featured ORM (ActiveRecord is not fully featured), or I might want to use SQL, or heck, I might want to do both for efficiency or to scratch a morning itch, who cares about the reason, please let me choose. Oh, and one more thing, what if I don’t want to use a SQL database at all? I want to use a native XML store or better yet a key/value store. Even if it’s just to piss someone off, I want to do this and one should be able to accomplish that pretty easily. I’m not asking for a mapper for these stores, simply just don’t make your framework bound to some relational store though making the work of turning this dependency off a 5 hour chore.)
  5. Supports AJAX (I should be able to easily render JSON or XML views, without much plumbing or lots of mappings and annotations. The authentications and forms support should also expose some form of ajax compliant interfaces, so that forms and authentication can be done using ajax if I choose so. Be able to easily parse submitted data into some data structure and validate/synchronize it with the domain model.)
  6. Bindings (All frameworks have some sort of bindings. Some of them are limiting. I don’t want to create command objects to just simply bind the data and than synch with my domain model. If I have domain object graph(s), I should be able to bind it in the view layer. Bindings should be customizable. In Spring MVC for example, you can only bind one input control to a field or set of fields in the command object, but what if I want to bind 3 input fields that collectively represent one field in the domain object, I’m out of luck, unless I use javascript to first serialize those input fields into one field. That really sucks.)
  7. Support RESTful, stateless, and other web concepts in a straightforward way. (I want to be able to configure every part of HTTP and the web and make the application work, look, interact in my way that’s compatible with the web, not your way. Some component based frameworks make that harder that it should be, like the fact that they are inherently stateful by default. Some make it hard to support RESTful or custom URI schemes, because they transfer state through URL rewriting. All of these problems don’t exist in some frameworks, like Rails, Spring MVC, Grails, etc…, so I know it’s possible.)
  8. Validations (Most have fully fledged validation support, but I can’t say that it can’t be made a bit easier. I do like Spring’s flexible validation support.)
  9. Forms (This is a big one. Can you provide a flexible way of creating forms and layouts. I mean seriously, we’re developing forms today the same way we’ve developed forms 15 years ago. Every other aspect of development has moved on, but we’re still doing bullshit html form controls. XForms is a way out, but no browser support and pretty hard to integrate support from vendors like Orbeon and Chiba makes the standard useless. Can we either embrace it or come up with something else. Am I the only one that gets an anxiety attack every time I think about creating yet another interactive form that doesn’t do anything much differently than the form I created 4 months ago for a different project, though I either have to copy and paste all the cruft or start from the absolute scratch. Wow, that’s sad IMO.)
  10. Scalability. I know this one again is not up to the framework, but as I mentioned before, the framework can make it easier or harder to achieve. For example, inherently stateful frameworks that require either session affinity or replication of session state, make it very hard to horizontally scale. Yes, I know you can scale with replications tools available out there, but any synchronous replications is not linearly scalable. So any such frameworks makes it harder. There are many other criteria that can make a framework more scalable than others, but in general, statelessness, stability, and speed makes it viable for faster scalability tunes.)

Ok, that’s it for now, I need to vent before my brain allows me to think of other things I’ve encountered of my never ending framework journey. I’d really love for someone to just say, hey you’re wrong, there is such a tool(s), here it is. I’d be eternally grateful. Many will say that it’s useless to complain, if I see a need, help create the framework or functionality that you think is needed. I wish I had more time, until then, I’ll continue to grunt and develop my own inner frameworks to make things easier. One day, if I have time, maybe I’ll devote some time into making some existing open source framework better. I’ve had more time years ago and contributed to quite a few open source projects that I’m truly starting to miss it now. I still occasionally submit a patch or two to a framework I’m working on after fixing an issue or adding some feature, but at times I’m in such a hurry to move on to the next task, I don’t have the time to package or generalize it enough to make it useful for everyone else.

Right now, I’m working with Grails after starting a project in Spring MVC and not being able to deliver functionality as quickly as I wanted. I’ll have to live with some issues I found with Grails when I was using it about 4 months ago, like the fact that you must use hibernate or gorm, crappy groovy stack traces, etc… Hey, there is always something one might not like, but I really like Grails and am hoping that now that it’s in the hands of SpringSource, they’ll spruce up the documentation to be more like Spring’s awesome documentation and clean it up a bit.

Update: I wanted to reiterate a bit on the Grails in regards to isolated domain model. Grails does allow you to create and isolate your domain model and its persistence, unfortunately you have to twist it’s arm if it’s anything outside of GORM. You don’t have to add classes to domain directory, but wtf is it there for? Also, it would be nice if the grails team provided a way to specify which classes in the domain directory are persistent or not. I mean, a domain model != persistent entities. So transient classes and other domain artifacts should also be grouped together. Putting them into src/groovy sucks personally, because I have to navigate two directories now to look at what’s supposed to be a coherent domain model.

Tags: , , , , ,

18 comments

  1. Could you please explain how Grails satisfies “Allows you to build your domain in isolation.”? Aren’t domain models in Grails pretty much tied to GORM for persistence and Grails itself for how validations are performed. While it doesn’t really force you to implement any methods in your models, it does specify conventions (validations must be in a static constraints block). So I don’t see how Grails lets to create your domain in complete isolation.

  2. Could you please explain how Grails satisfies “Allows you to build your domain in isolation.”? Aren’t domain models in Grails pretty much tied to GORM for persistence and Grails itself for how validations are performed. While it doesn’t really force you to implement any methods in your models, it does specify conventions (validations must be in a static constraints block). So I don’t see how Grails lets to create your domain in complete isolation.

  3. Chandru, first I didn’t mention that Grails allows me to do that in complete isolation. That was just my requirement, the fact that I chose Grails to move forward didn’t have much to do with it’s isolation capabilities. I’m actually rather not satisfied with any of the new Rails style frameworks, as most of them force you into some framework for persistence or into a convention that’s hard to bend at times. With that said, in Grails it’s actually not that bad. You don’t have to use GORM at all, you are free to define your domain as an isolated module (jar) and then just utilize grails for it’s controller/view and other helper utilities. You won’t get the dynamic methods this way and are going to have to validate outside of GORM. I actually believe there is a way to add some dynamic aspects of GORM to java defined JPA beans, but I don’t think you’ll get 100% of the functionality. But again, but going outside of GORM, I take it you’ve already made a conscious decision to isolate your domain for use outside of just a web framework and you are willing to do the plumbing yourself. Also, the GORM dynamic finders don’t really appeal to me. They are too reminiscent of DAO pattern (or anti-pattern in my opinion), which doesn’t expose your domain aggregate roots and though makes each object a first class navigable association. I’d rather define my domain model as POJOs (which GORM is not) and use the repository layer to abstract it away from my services layer. GORM IMO is an awesome technology, but doesn’t provide the flexibility needed by more complex domain models (domain model I mean in terms of DDD, not what Grails defines a domain model, which are only persistent entities). The nice thing about grails is you can use GORM initially to get your project up and running, but you can later isolate parts or all of your domain and utilize Grails to access that domain as just any other java API.

  4. Chandru, first I didn’t mention that Grails allows me to do that in complete isolation. That was just my requirement, the fact that I chose Grails to move forward didn’t have much to do with it’s isolation capabilities. I’m actually rather not satisfied with any of the new Rails style frameworks, as most of them force you into some framework for persistence or into a convention that’s hard to bend at times. With that said, in Grails it’s actually not that bad. You don’t have to use GORM at all, you are free to define your domain as an isolated module (jar) and then just utilize grails for it’s controller/view and other helper utilities. You won’t get the dynamic methods this way and are going to have to validate outside of GORM. I actually believe there is a way to add some dynamic aspects of GORM to java defined JPA beans, but I don’t think you’ll get 100% of the functionality. But again, but going outside of GORM, I take it you’ve already made a conscious decision to isolate your domain for use outside of just a web framework and you are willing to do the plumbing yourself. Also, the GORM dynamic finders don’t really appeal to me. They are too reminiscent of DAO pattern (or anti-pattern in my opinion), which doesn’t expose your domain aggregate roots and though makes each object a first class navigable association. I’d rather define my domain model as POJOs (which GORM is not) and use the repository layer to abstract it away from my services layer. GORM IMO is an awesome technology, but doesn’t provide the flexibility needed by more complex domain models (domain model I mean in terms of DDD, not what Grails defines a domain model, which are only persistent entities). The nice thing about grails is you can use GORM initially to get your project up and running, but you can later isolate parts or all of your domain and utilize Grails to access that domain as just any other java API.

  5. Nice points to choosing a web development framework/toolkit. Thanks for sharing it.

  6. Nice points to choosing a web development framework/toolkit. Thanks for sharing it.

  7. For the OP.. I am curious. did you know Ruby and grails before taking it on after you felt Spring MVC was too cumbersome? I’ve dabbled in Ruby a wee bit and find it’s language syntax quite cryptic. Haveing done OO Pascal, C/C++ and Java, they feel like languages to me. Ruby, Perl, PHP, those scripting languages feel out of place to me. I know if I spent the time I could learn them, but why? So far I haven’t found any reason to switch because Java is far more robust for much more than what any one of these languages offers. To be fair, JRuby and those that run on the JVM have the JDK stack available, but I don’t see the point in using a new language just for the sake of learning something new. They feel like toys to me and while they may offer some of those that just don’t like the Java language some new way of doing the same thing, at least to me, Java is a much more powerful platform than any other language out there. I am also amazed at how many Ruby developers say how much faster it is? Forgive me for using copy/paste, but I can get a full scale J2EE app complete with EJB, mysql integration, MVC, separation of tiers, etc in a very short time, couple hours tops if not less. Then I just start adding my code for specific functionality. I am failing to understand the developers, especially those coming from Java that rave about how fast it is to develop in Ruby. Now on to your topic specifically. You mention REST, MVC, and many other things. It sounds like you want the end all framework and to this day I don’t think any provides it all, although combining Spring + Hibernate or EJB3, and a couple other frameworks sounds like it would do what you want. There is no single framework that does what you want, and I’d guess there never will be with so many solid frameworks already available. Short of you developing your own from scratch, I can’t imagine someone skipping out on all the good frameworks now available to start yet another one. Most can do in some way what you ask for, and with a little bit of inter connectivity, you generally can get anything working within Spring. Mind you, I am no Spring aficionado, I’ve used it a little bit, that’s all so I am not trying to plug it. So.. one thing I find really good is using Jersey for it’s REST capabilities and using it from AJAX directly to bypass the need for a pure MVC framework. It allows me to offer 3rd parties a solid REST api, and I can use it as well from my own web UI with AJAX. It does NOT do the form auto population into objects, validations, etc. But I don’t often find that too hard to put in anyway. Even so, I could use another framework or sub projects out there to do most of this anyway. I haven’t checked recently, but I’d guess there are some smaller validation libraries and form to object population libraries out there. What I find most puzzling regarding your post and many other developers is often the complexity that they seem to go thru to avoid doing work. The configs and such to get all these parts working to me means more moving targets for problems at deployment, as well as I often find I spend more time writing xml config code to get thing to work together than I do writing code. These days, using the Jersey REST library with EJB3 I find I can quite easily handle most everything right in code without any sort of configuration issues. I have the jersey config in my web.xml, the rest is in code and works great. No multiple configs to worry about, less dependencies on various frameworks and what version they are and what they depend on and what I am missing on my classpath. It seems as we’ve all grown into these large robust frameworks, we’ve add a lot of extra complexity to make them work just to try to save a few lines of code here and there. Don’t get me wrong..I think they are great, but I think they add complexity that is often not needed. I’ve seen numerous hours, days sometimes with a simple deployment due to various dependencies and developers not knowing how that all works. It’s often too easy to read some tutorial online about how to get this to work with that, and that is all they do.. they don’t understand the inner workings and it causes more problems than it solves. It’s much like developers that don’t know much about how the classpath works, how classloaders work, how memory management works in Java. Anyway.. just my thoughts on this.

  8. For the OP.. I am curious. did you know Ruby and grails before taking it on after you felt Spring MVC was too cumbersome? I’ve dabbled in Ruby a wee bit and find it’s language syntax quite cryptic. Haveing done OO Pascal, C/C++ and Java, they feel like languages to me. Ruby, Perl, PHP, those scripting languages feel out of place to me. I know if I spent the time I could learn them, but why? So far I haven’t found any reason to switch because Java is far more robust for much more than what any one of these languages offers. To be fair, JRuby and those that run on the JVM have the JDK stack available, but I don’t see the point in using a new language just for the sake of learning something new. They feel like toys to me and while they may offer some of those that just don’t like the Java language some new way of doing the same thing, at least to me, Java is a much more powerful platform than any other language out there. I am also amazed at how many Ruby developers say how much faster it is? Forgive me for using copy/paste, but I can get a full scale J2EE app complete with EJB, mysql integration, MVC, separation of tiers, etc in a very short time, couple hours tops if not less. Then I just start adding my code for specific functionality. I am failing to understand the developers, especially those coming from Java that rave about how fast it is to develop in Ruby. Now on to your topic specifically. You mention REST, MVC, and many other things. It sounds like you want the end all framework and to this day I don’t think any provides it all, although combining Spring + Hibernate or EJB3, and a couple other frameworks sounds like it would do what you want. There is no single framework that does what you want, and I’d guess there never will be with so many solid frameworks already available. Short of you developing your own from scratch, I can’t imagine someone skipping out on all the good frameworks now available to start yet another one. Most can do in some way what you ask for, and with a little bit of inter connectivity, you generally can get anything working within Spring. Mind you, I am no Spring aficionado, I’ve used it a little bit, that’s all so I am not trying to plug it. So.. one thing I find really good is using Jersey for it’s REST capabilities and using it from AJAX directly to bypass the need for a pure MVC framework. It allows me to offer 3rd parties a solid REST api, and I can use it as well from my own web UI with AJAX. It does NOT do the form auto population into objects, validations, etc. But I don’t often find that too hard to put in anyway. Even so, I could use another framework or sub projects out there to do most of this anyway. I haven’t checked recently, but I’d guess there are some smaller validation libraries and form to object population libraries out there. What I find most puzzling regarding your post and many other developers is often the complexity that they seem to go thru to avoid doing work. The configs and such to get all these parts working to me means more moving targets for problems at deployment, as well as I often find I spend more time writing xml config code to get thing to work together than I do writing code. These days, using the Jersey REST library with EJB3 I find I can quite easily handle most everything right in code without any sort of configuration issues. I have the jersey config in my web.xml, the rest is in code and works great. No multiple configs to worry about, less dependencies on various frameworks and what version they are and what they depend on and what I am missing on my classpath. It seems as we’ve all grown into these large robust frameworks, we’ve add a lot of extra complexity to make them work just to try to save a few lines of code here and there. Don’t get me wrong..I think they are great, but I think they add complexity that is often not needed. I’ve seen numerous hours, days sometimes with a simple deployment due to various dependencies and developers not knowing how that all works. It’s often too easy to read some tutorial online about how to get this to work with that, and that is all they do.. they don’t understand the inner workings and it causes more problems than it solves. It’s much like developers that don’t know much about how the classpath works, how classloaders work, how memory management works in Java. Anyway.. just my thoughts on this.

  9. Kevin, I have dabbled in ruby/python frameworks for a bit before forming my opinions. I wouldn’t consider myself an expert in them and wouldn’t necessarily say that my mind wouldn’t change if I’ve used one of them for quite a while. Ruby or Python didn’t seem foreign to me, hey, I was a Perl guy before Java 🙂 To say that these languages are toys is pretty uninformed to be honest, they are true proven languages. Perl’s probably running as many if not more production critical systems than java, it’s just not as hyped any more. Amazon’s store front is mostly written in perl. Python powers lots of google’s infrastructure and PHP powers yahoo, so not sure what you mean by toy languages. Now with that said, most good programmers learn different languages even if their day job doesn’t allow them to use it. New ideas, ways of thinking, etc… are spawned through learning different languages and frameworks. I’d much rather hire someone who’s worked in a heterogenous environment, understands the concepts and is not proficient in a particular language we’re looking for, than to get someone who only programs in Java and uses it’s echosystem. There is no doubt that java and it’s libraries are probably the most stable and sufficient frameworks for developing enterprise apps, but you also must look at other factors. Thankfully with the advent of other languages running on the JVM, you now have a choice. I wrote up a piece a few weeks ago on Groovy SQL builders for example. I could have also done it in Java, but what a pain it would have been. Now, to say that we want to save a few lines (actually many lines) of code, is true. But I don’t see anything wrong with it. That’s the nature of computer science, building abstractions, otherwise we’d be writing code in assembly and telling java developers how dare they want to save a few lines of code. There are times when it’s important to understand the lower level details, there are times when it’s not as important. Now, even if I do understand it, I wouldn’t say I’d really want to say parse raw HTTP packets, even though I’ve rather familiar with them. I’d rather the framework take care of that for me. The same is true for other cross cutting concerns. If we can get an abstraction to take care of it for us, more power to the abstraction. Yes, there are side cases when you have to get dirty into the implementation details, but with good abstractions, these should be far and between. There are of course “leaky abstractions”, which I still think are beneficial, they just expose the underlying problems with what we’re trying to abstract. I love java, i’ve programmed java for the last 10 years, but with that said Java is not the end all of software development. There are better suitors for particular problems. Like Erlang or Scala for distributed and multi threaded programming (have you even tried multi-threaded programing with java’s thread primitives? If you’ve ever developed any serious multithreaded app in java, you’ll know that it’s super hard, it’s non-deterministic, and because of that it’s bug prone even when you tested the heck out of it). You also have Groovy, which brings some level of dynamic programming to Java. I don’t particularly love groovy, but I like it’s interop with java. Also, Clojure looks awesome for functional abstractions and multi-core concurrency through STM.

  10. Kevin, I have dabbled in ruby/python frameworks for a bit before forming my opinions. I wouldn’t consider myself an expert in them and wouldn’t necessarily say that my mind wouldn’t change if I’ve used one of them for quite a while. Ruby or Python didn’t seem foreign to me, hey, I was a Perl guy before Java 🙂 To say that these languages are toys is pretty uninformed to be honest, they are true proven languages. Perl’s probably running as many if not more production critical systems than java, it’s just not as hyped any more. Amazon’s store front is mostly written in perl. Python powers lots of google’s infrastructure and PHP powers yahoo, so not sure what you mean by toy languages. Now with that said, most good programmers learn different languages even if their day job doesn’t allow them to use it. New ideas, ways of thinking, etc… are spawned through learning different languages and frameworks. I’d much rather hire someone who’s worked in a heterogenous environment, understands the concepts and is not proficient in a particular language we’re looking for, than to get someone who only programs in Java and uses it’s echosystem. There is no doubt that java and it’s libraries are probably the most stable and sufficient frameworks for developing enterprise apps, but you also must look at other factors. Thankfully with the advent of other languages running on the JVM, you now have a choice. I wrote up a piece a few weeks ago on Groovy SQL builders for example. I could have also done it in Java, but what a pain it would have been. Now, to say that we want to save a few lines (actually many lines) of code, is true. But I don’t see anything wrong with it. That’s the nature of computer science, building abstractions, otherwise we’d be writing code in assembly and telling java developers how dare they want to save a few lines of code. There are times when it’s important to understand the lower level details, there are times when it’s not as important. Now, even if I do understand it, I wouldn’t say I’d really want to say parse raw HTTP packets, even though I’ve rather familiar with them. I’d rather the framework take care of that for me. The same is true for other cross cutting concerns. If we can get an abstraction to take care of it for us, more power to the abstraction. Yes, there are side cases when you have to get dirty into the implementation details, but with good abstractions, these should be far and between. There are of course “leaky abstractions”, which I still think are beneficial, they just expose the underlying problems with what we’re trying to abstract. I love java, i’ve programmed java for the last 10 years, but with that said Java is not the end all of software development. There are better suitors for particular problems. Like Erlang or Scala for distributed and multi threaded programming (have you even tried multi-threaded programing with java’s thread primitives? If you’ve ever developed any serious multithreaded app in java, you’ll know that it’s super hard, it’s non-deterministic, and because of that it’s bug prone even when you tested the heck out of it). You also have Groovy, which brings some level of dynamic programming to Java. I don’t particularly love groovy, but I like it’s interop with java. Also, Clojure looks awesome for functional abstractions and multi-core concurrency through STM.

  11. I hear what you are saying Ilya. I don’t know that I’d want to hire someone with a little play time in multiple languages for my java based system over someone that has worked solidly in java but doesn’t have any experience in the others. It seems to me an expert in the language you are using is a far better choice than someone that knows it decently but also brings to the table a couple other languages which you don’t use. Oddly enough, in my early 20’s, when I had lots of energy and no kids, I loved learning new frameworks and languages. But, today it is a lot different… we have huge resources available to us via the internet, and I’ve barely tapped the Java language to know it’s full potential, let alone trying to spend time that I could (and should) be using on my day job learning a new language or two that I most likely won’t be able to use. By toy language I mean they are barely an itch in the industry compared to Java or .NET, and that so far most people I see using them often are the ones that didn’t care for Java or are tired of Java for one reason or another and want something new. Despite many sites popping up with php, ruby and python, they are still minuscule compared to the jobs available and sites built on java, or even .NET. I look at a couple of other things too. For example, iPhone’s language is objective C. Androids is Java. These two potentially huge platforms (iPhone already is and Android is fast on its way) chose these instead of languages like groovy, ruby, etc. I can’t help but ask, if Ruby, Python, Scala and these others are so much easier to use, faster to develop with, why not choose a language like this to write small phone apps over the larger robust languages? Maybe this isn’t a fair argument, but it does make me ask why the simpler faster languages were not chosen? See, back when there were a couple main languages, like assembly, pascal, c/c++ and java, they were all used quite in abundance…even Basic. But now, we have a crap load of “the next language to replace java” springing up, most of which are scripted languages not even compiling languages, and the few that use them rave about them and some how get a small following of people that jump aboard and hype it up as if it’s the next big thing. I see tons of blog posts about how scala will replace Java, how groovy is going to replace java, etc. Yet, nothing has come close. Even Ruby and PHP aren’t even close. They stand the most chance to make a fraction of a dent, but won’t ever come close. I honestly kind of get tired of seeing all the rants about having to learn all these languages. I have enough to do with Java and one job to keep me busy for years to come, and I truly love the language. I spent the time to learn a lot of it’s inner workings, to think about having to go do that all over again because a fraction of developers who are tired of Java for one reason or another (most of which have arguments that really aren’t that valid) say so I don’t know.. it just doesn’t seem like it’s necessary. Now, let’s say there was no ruby/rails, php, python, etc and some newer language, pure OO, cleaner syntax, etc came out, it might be worth looking in to if it really offered something better. But I haven’t seen any argument yet that indicates any of these languages are better or offer anything more than what Java does already. The biggest argument is speed of development. Hmm.. copy/paste of tried/tested code works for me. Java is a well understood language, with tons and tons of money and sharp minds behind it, using it. I don’t see anything Ruby, PHP or any other language offers me that is better than what Java does. It’s almost like the “If it ain’t broke, don’t try to fix it” analogy. Java comes on every OS out there now, Ruby and PHP do not. I know that anything I write in Java will almost always run on any of the OSes out there out of the box (give or take the few that aren’t updated to 1.6 yet.. thankfully OSX finally is.. but 1.5 is still there), I can’t say the same for any other language out there except maybe C. I could probably go on all day. You did make a good point.. to me php and ruby are very similar to perl and I only dabbled in perl. Like I said in my first post, I find the language syntax to be confusing and hard to read. Maybe it takes time.. but every developer blog I read about these languages raves about how fast and easy it is to develop in, and I don’t consider myself a beginner developer but after looking at source and reading a book on Ruby, I still find it hard to work with and cryptic to read. Maybe my mind is stuck in the Basic/C/Pascal/Java like code style, but they make sense to me. These others ones are strange to look at and remind me highly of shell scripting and perl, neither of which I care for. lol.

  12. I hear what you are saying Ilya. I don’t know that I’d want to hire someone with a little play time in multiple languages for my java based system over someone that has worked solidly in java but doesn’t have any experience in the others. It seems to me an expert in the language you are using is a far better choice than someone that knows it decently but also brings to the table a couple other languages which you don’t use. Oddly enough, in my early 20’s, when I had lots of energy and no kids, I loved learning new frameworks and languages. But, today it is a lot different… we have huge resources available to us via the internet, and I’ve barely tapped the Java language to know it’s full potential, let alone trying to spend time that I could (and should) be using on my day job learning a new language or two that I most likely won’t be able to use. By toy language I mean they are barely an itch in the industry compared to Java or .NET, and that so far most people I see using them often are the ones that didn’t care for Java or are tired of Java for one reason or another and want something new. Despite many sites popping up with php, ruby and python, they are still minuscule compared to the jobs available and sites built on java, or even .NET. I look at a couple of other things too. For example, iPhone’s language is objective C. Androids is Java. These two potentially huge platforms (iPhone already is and Android is fast on its way) chose these instead of languages like groovy, ruby, etc. I can’t help but ask, if Ruby, Python, Scala and these others are so much easier to use, faster to develop with, why not choose a language like this to write small phone apps over the larger robust languages? Maybe this isn’t a fair argument, but it does make me ask why the simpler faster languages were not chosen? See, back when there were a couple main languages, like assembly, pascal, c/c++ and java, they were all used quite in abundance…even Basic. But now, we have a crap load of “the next language to replace java” springing up, most of which are scripted languages not even compiling languages, and the few that use them rave about them and some how get a small following of people that jump aboard and hype it up as if it’s the next big thing. I see tons of blog posts about how scala will replace Java, how groovy is going to replace java, etc. Yet, nothing has come close. Even Ruby and PHP aren’t even close. They stand the most chance to make a fraction of a dent, but won’t ever come close. I honestly kind of get tired of seeing all the rants about having to learn all these languages. I have enough to do with Java and one job to keep me busy for years to come, and I truly love the language. I spent the time to learn a lot of it’s inner workings, to think about having to go do that all over again because a fraction of developers who are tired of Java for one reason or another (most of which have arguments that really aren’t that valid) say so I don’t know.. it just doesn’t seem like it’s necessary. Now, let’s say there was no ruby/rails, php, python, etc and some newer language, pure OO, cleaner syntax, etc came out, it might be worth looking in to if it really offered something better. But I haven’t seen any argument yet that indicates any of these languages are better or offer anything more than what Java does already. The biggest argument is speed of development. Hmm.. copy/paste of tried/tested code works for me. Java is a well understood language, with tons and tons of money and sharp minds behind it, using it. I don’t see anything Ruby, PHP or any other language offers me that is better than what Java does. It’s almost like the “If it ain’t broke, don’t try to fix it” analogy. Java comes on every OS out there now, Ruby and PHP do not. I know that anything I write in Java will almost always run on any of the OSes out there out of the box (give or take the few that aren’t updated to 1.6 yet.. thankfully OSX finally is.. but 1.5 is still there), I can’t say the same for any other language out there except maybe C. I could probably go on all day. You did make a good point.. to me php and ruby are very similar to perl and I only dabbled in perl. Like I said in my first post, I find the language syntax to be confusing and hard to read. Maybe it takes time.. but every developer blog I read about these languages raves about how fast and easy it is to develop in, and I don’t consider myself a beginner developer but after looking at source and reading a book on Ruby, I still find it hard to work with and cryptic to read. Maybe my mind is stuck in the Basic/C/Pascal/Java like code style, but they make sense to me. These others ones are strange to look at and remind me highly of shell scripting and perl, neither of which I care for. lol.

  13. there are many points things needed for to start web development . . . as you written you gotta done at all above in the article. . you just go ahead & start the journey of web development . .

  14. there are many points things needed for to start web development . . . as you written you gotta done at all above in the article. . you just go ahead & start the journey of web development . .

  15. I liked reading this post and the subsequent thread and I think I agree with much of what you said, thanks for taking the time to share your thoughts publicly. How do you feel about your choice of Grails 6 or so months on? Has it continued to deliver benefit to you? Are there any obvious problems? Are you busy coding round any one particular aspect of the framework? I ask because I just took the decision to go Grails for a new project and am getting increasingly scared that it is unlikely to perform or scale. I have a lot of database design experience and I am suspending my disbelief that hibernate in its default GORM incarnation is going to get the queries right. I deliberately want an almost join-less database model and am already finding myself using composition to keep the code neat and the domain model sane. This does seem to cut against the Grails convention as you mentioned and I hate having to make my domain model and persistence model identical. Rather than that being an acceptable convention it feels like a naive restriction imposed by a Java framework team who may never have had to build really scalable database applications – but maybe that’s being a bit harsh. Incidentally I recently spent some time coding C for embedded devices after a long time in Java and Web frameworks. The key thing there is that everything fits inside 64k. Coming back to the incredibly wasteful world of normal programming makes me wonder when the framework fad will shed its obesity and free up all those CPU cycles that it spends doing stuff which made the programmer’s life easier.

  16. I liked reading this post and the subsequent thread and I think I agree with much of what you said, thanks for taking the time to share your thoughts publicly. How do you feel about your choice of Grails 6 or so months on? Has it continued to deliver benefit to you? Are there any obvious problems? Are you busy coding round any one particular aspect of the framework? I ask because I just took the decision to go Grails for a new project and am getting increasingly scared that it is unlikely to perform or scale. I have a lot of database design experience and I am suspending my disbelief that hibernate in its default GORM incarnation is going to get the queries right. I deliberately want an almost join-less database model and am already finding myself using composition to keep the code neat and the domain model sane. This does seem to cut against the Grails convention as you mentioned and I hate having to make my domain model and persistence model identical. Rather than that being an acceptable convention it feels like a naive restriction imposed by a Java framework team who may never have had to build really scalable database applications – but maybe that’s being a bit harsh. Incidentally I recently spent some time coding C for embedded devices after a long time in Java and Web frameworks. The key thing there is that everything fits inside 64k. Coming back to the incredibly wasteful world of normal programming makes me wonder when the framework fad will shed its obesity and free up all those CPU cycles that it spends doing stuff which made the programmer’s life easier.

  17. Great post, I couldn’t agree more about domain modeling. I discovered Grails recently and with its Hibernate support I was hopeful that the framework would be a complete solution, but alas it’s not nearly flexible enough in terms of separating persistence from your domain and creating a rich domain model.

  18. Very Good post & useful!

Leave a comment