The Artima Developer Community
Sponsored Link

Articles Forum
Broken Dependencies

7 replies on 1 page. Most recent reply: Jun 18, 2007 7:27 AM by Ian Robertson

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 7 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Broken Dependencies Posted: Jun 12, 2007 5:30 PM
Reply to this message Reply
Advertisement
In this interview with Artima, Bill Roth, BEA vice president and unit executive of the company's Workshop division, discusses ways to manage dependencies of artifacts in a Web application:

http://www.artima.com/lejava/articles/javaone_2007_bill_roth.html

What strategies do you follow to manage dependencies in your applications?


Sakke Wiik

Posts: 5
Nickname: sakkew
Registered: Dec, 2003

Re: Broken Dependencies Posted: Jun 13, 2007 7:32 AM
Reply to this message Reply
A comprehensive suite of automated web tests takes care of most dependency related issues and other bugs. They're also very cheap to generate. Check out Selenium and the test recorder plug-in. You'll have a good suite of tests in no time.

Execute them against your deployable from a continuous integration engine with Cargo, and the testing takes care of itself.


cheers,
Sakke Wiik

Ian Robertson

Posts: 68
Nickname: ianr
Registered: Apr, 2007

Re: Broken Dependencies Posted: Jun 13, 2007 8:26 AM
Reply to this message Reply
> A comprehensive suite of automated web tests takes care of
> most dependency related issues and other bugs. They're
> also very cheap to generate. Check out Selenium and the
> test recorder plug-in. You'll have a good suite of tests
> in no time.

While testing is definitely a Good Thing, having something like design-time or compile-time checking is better still. I shouldn't have to package, deploy and start up my web app, and then run an integration testing suite, just to find out that I typed foo.getFar() in my template, when Foo only has a getBar() method. Unfortunately, precious few templating languages for Java offer the ability to detect these sorts of problems during development.

Sakke Wiik

Posts: 5
Nickname: sakkew
Registered: Dec, 2003

Re: Broken Dependencies Posted: Jun 14, 2007 12:41 AM
Reply to this message Reply
I fully agree. I take it for granted that an IDE highlights broken dependencies.
I'm still not fully comfortable with that. Testing against the deliverable proves that the build builds the package the same way your project in the IDE is configured.

Ian Robertson

Posts: 68
Nickname: ianr
Registered: Apr, 2007

Re: Broken Dependencies Posted: Jun 14, 2007 7:18 AM
Reply to this message Reply
Good point - IDE highlighting of problems adds efficiency, but is no substitute for testing. That said, dependencies that can be enforced through the compilation process which is used to produce the deliverable do provide a real element of safety. This is a big reason I've never been able to tolerate JSP - it postpones way too many errors until runtime.

Sakke Wiik

Posts: 5
Nickname: sakkew
Registered: Dec, 2003

Re: Broken Dependencies Posted: Jun 18, 2007 12:08 AM
Reply to this message Reply
Precompiling JSP pages with JSPC can be attached to the build. It will check the syntax at least.

Eivind Eklund

Posts: 49
Nickname: eeklund2
Registered: Jan, 2006

Re: Broken Dependencies Posted: Jun 18, 2007 3:32 AM
Reply to this message Reply
> While testing is definitely a Good Thing, having something
> like design-time or compile-time checking is better still.
> I shouldn't have to package, deploy and start up my web
> b app, and then run an integration testing suite, just to
> find out that I typed foo.getFar() in my
> template, when Foo only has a getBar()
> method.

Depends on the cost. How much extra declarations do you need to add to get the checks, how often are these in the way of legitimate changes, and what programming methods do you lose by the forced mapping to known methods?

Of course, if checking for this is free, then it is of course better to get it at compile or design time. If the cost is higher than 0, then it is a trade off. (For instance, in Java I find that these checks come at a cost of 70%+ increase in code size compared to dropping all declarations and testing runtime, like Ruby does.)

Ian Robertson

Posts: 68
Nickname: ianr
Registered: Apr, 2007

Re: Broken Dependencies Posted: Jun 18, 2007 7:27 AM
Reply to this message Reply
> Precompiling JSP pages with JSPC can be attached to the
> build. It will check the syntax at least.

True. Unfortunately, JSP goes out of its way to create an illusion of loose coupling where there is none. A JSP page may (effectively) require that it be passed two variables, that one of them be labeled "customer" and be of type Customer, and that the other be labeled "order" and be of type "Order". Unfortunately, none of this is checked prior to runtime. I believe this was a fundamentally poor design choice on Sun's part, no doubt due in part to the rush to quickly come up with an answer to ASP.

Flat View: This topic has 7 replies on 1 page
Topic: The Uses of Implicit Application State Previous Topic   Next Topic Topic: Event-Driven Web Applications

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use