Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I write enterprise Java applications and web services at work (Spring, Hibernate, Maven, RESTEasy) and PHP (CakePHP) and Python (Django) for my side projects.

While I do see the value that Inversion of Control, Aspect Oriented Programming etc. that Spring brings in, I am not sure how massive web applications that are not on the Java stack manage without a framework like Spring.

So, do the developers just have to "put up with" tightly coupled components and other grievances that Spring eliminates or am I missing something?

For those unfamiliar with Spring, the features we use the most are:

  • Inversion of Control container: configuration of application components and lifecycle management of Java objects,

  • Aspect-oriented programming: enables implementation of cross-cutting routines,

  • Transaction management: unifies several transaction management APIs and coordinates transactions for Java objects.

share|improve this question
3  
You'll probably get better answers if you at least briefly explain what Spring does. –  Per Johansson Nov 4 '11 at 21:22
1  
Thanks, added more details. –  rdasxy Nov 4 '11 at 21:49
4  
Just because Pythonistas don't use Java's buzzwords, doesn't mean, that design patterns are significantly different. Well, maybe except loss less bloat. –  vartec Nov 5 '11 at 17:41
5  
Even with your definition I still have absolutely no idea what Spring does. –  sevenseacat Nov 7 '11 at 7:55
    
And that is one of the biggest grievances I have with Spring. Before I started doing Java enterprise development, I had no need for it. –  rdasxy Nov 8 '11 at 22:35

4 Answers 4

up vote 14 down vote accepted

Other platforms don't need Spring because those languages are not anywhere near as restrictive as Java.

I'll give an example with node.js

  • Inversion of Control container: configuration of application components and lifecycle management of Java objects

server configuration is done either in code or a simple json config file. As for generic IoC systems, we simply don't need them, Javascript is an expressive and dynamic language. Yes you need IoC but that's simple, pass dependencies to your objects as function parameters.

  • Aspect-oriented programming: enables implementation of cross-cutting routines

I simply don't think we need something like this, we write modular code and it just works.

  • Transaction management: unifies several transaction management APIs and coordinates transactions for Java objects

noSQL is incredibly popular. There is no notion of transaction.

Personally I would say such systems are bloated and over engineered and you just don't need them. Other languages and platforms simply stay lean and agile.

share|improve this answer
7  
You've also missed how simple it is to use duck typing and monkey patching to inject stuff in Python and Ruby. –  Danny Staple Nov 4 '11 at 23:44
3  
Right, the reason other languages don't have Spring is because... they don't need Spring to actually be useful ;-) –  Dean Harding Nov 5 '11 at 0:01
6  
Saying you don't need IoC, AOP or transactional management is short sighted and wrong. Many high level languages allow you to easily write code using AOP and/or IoC design principles. It's just that most of the high level languages don't need an explicit class or container to provide those capabilities. –  dietbuddha Nov 5 '11 at 4:02
2  
@Raynos As for generic IoC systems, we simply don't need them, javascript is an expressive and dynamic language. This is misinformation to some degree. You don't think you need them. coffeescripter.com/2010/08/… –  Aaron McIver Nov 5 '11 at 4:56
2  
@AaronMcIver you were right, we need IoC. –  Raynos Dec 20 '11 at 16:05

In most high level languages it's trivial to write using AOP and/or IoC design principles.

All you need to implement AOP is for the language to support higher order functions. For example:

def log(fn):
  def wrapped_fn(*a, **kw):
    logger.log(fn_formatter(fn, a, kw))
    return fn(*a, **kw)
  return wrapped_fn

@log
def do_something(my_friend):
  return have_fun_with(my_friend)

You can also follow general IoC or Dependency Injection principles when programming. You don't need a particular container to provide that capability. You can just write the code that way.

def etl(iextract, transformations, iload):
  return iload(itertools.imap(compose(*transformations), iextract()))
share|improve this answer

Well Python enjoys the Spring also Spring Python.

Spring framework was created to ease Java development and what is true for Java development isn't necessary true for Ruby or Python development.

Ruby for example has Metaprogramming capabilities which means you can create your own AOP.

Ironically though, new Java web frameworks are trying to catch Django and Rails frameworks (see Grails and Play! frameworks for example).

share|improve this answer
1  
+1 for name-dropping the Play! framework –  Mike Nov 4 '11 at 23:39
4  
Grails is not a Java framework. It is a Groovy framework. Groovy compiles to Java byte code, but it is not Java. –  kevin cline Nov 5 '11 at 15:27
    
@kevincline Yeah I known but at the end of day it is a JVM web framework (built on Spring and Hibernate). –  Chiron Nov 5 '11 at 22:18
1  
Yeah, the great thing about Grails is that you don't have to know Spring. –  kevin cline Nov 5 '11 at 23:01
    
@kevincline Not necessarily true. Sometimes you have to fall back to Spring and tweak things here and there –  Chiron Nov 5 '11 at 23:13

For Python, BlueBream (aka Zope 3) provides what Spring does and more.

Complexity and power comes at a cost, there are times when you don't want to pay it.

Many programmers find BlueBream daunting and way too much for what they need to do, they prefer leaner, smaller toolkits. Most of the other solutions (Django, etc.) are based on the MVC paradigm.

You can see a similar forces in action in the Java space as well, with things like the beautiful Playframework.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.