Tapestry for Nonbelievers
A new article by I. Drobiazko and R. Zubairov introduces v. 5 of the Apache Tapestry component-oriented web framework. The tutorial shows how to create a component and covers IoC in Tapestry and Ajax.
Tracking change and innovation in the enterprise software development community
Posted by Sadek Drobi on Apr 11, 2008 01:32 PM
Echoing at a discussion on dynamic vs. static languages, Debasish Ghosh raises the issue of using dynamic type-checking while programming with static languages. He recalls the common generalization of Greenspun's 10th Law: "any sufficiently complicated program in a statically-typechecked language contains an ad-hoc, informally-specified bug-ridden slow implementation of a dynamically-checked language."
Ghosh believes that this is not necessarily so today. He argues that Java generics, e.g. Guice and EasyMock, allow avoiding workarounds necessary to enforce runtime type checking:
Using Java generics, these frameworks allow compile time type checking for cases which would earlier have to be implemented using a slow and bug ridden simulation of runtime type checking. Guice and EasyMock stand out as two frameworks I have been using that have used the power of generics to implement extraordinary typesafety. […]
Have a look at this piece of code, which binds an implementation
SpecialServiceImplto the interfaceServiceusing GuiceBinder.public class MyModule implements Module {
public void configure(Binder binder) {
binder.bind(Service.class)
.to(SpecialServiceImpl.class)
.in(Scopes.SINGLETON);
}
}”
Even though “it may seem that the "implements" relationship between Service and SpecialServiceImpl is done during runtime”, all type checking is actually done during compile time:
A peek at the source code of Guice reveals that
BinderImpl.bind()returnsBindingBuilderImpl..public
BindingBuilderImpl bind(Class clazz) {
return bind(Key.get(clazz));
}and
BindingBuilderImpltakes as input.to() Class- the bound on the wild card enforces the above "implements" relationship as part of compile time type checking of the arguments ..public ScopedBindingBuilder to(Classextends T> implementation) {
return to(TypeLiteral.get(implementation));
}
Debasish Ghosh advocates for using this kind of solutions rather than trying to achieve dynamic type checking. Not only does it allow avoiding the Greenspun's10th Law but it optimizes the advantages of static typing because it guarantees strong type-safety:
When you are programming in a statically typed language, use appropriate language features to make most of your type checking at compile time. This way, before you hit the run button, you can be assured that your code is well-formed within the bounds of the type system. And you have the power of easier refactoring and cleaner evolution of your codebase.
Introducing the SpringSource Application Platform
SpringSource Launches New Application Server without Java EE
Rational Model Driven Development eKit: Examples, Tutorials, Webcasts
IBM software architect eKit: Grady Booch podcast, whitepapers, articles
A new article by I. Drobiazko and R. Zubairov introduces v. 5 of the Apache Tapestry component-oriented web framework. The tutorial shows how to create a component and covers IoC in Tapestry and Ajax.
In this interview, Burton Group consultant Pete Lacey talks to Stefan Tilkov about his disillusionment with SOAP, his opinion on REST, and addresses some of the perceived shortcomings REST vs. WS-*.
Jay Fields presents his concept of Business Natural Languages - a type of Domain Specific Languages geared towards being readable by domain experts.
Adoption and interest for Distributed Version Control Systems is constantly rising. We will introduce the concept of DVCS and have a look at 3 actors in the area: git, Mercurial and Bazaar.
Deborah Hartmann interviewed Segundo Velasquez about his experience as customer with an Agile team during the initial phase of software design of a product.
David Cooksey shows how to fine grained versioning to a ClickOnce deployment using an HttpHandler written with ASP.NET, making partial rollouts to a test audience much easier.
Windows workflow (WF) is an excellent framework for implementing business processes, but lacks support for human activities. This article describes a completely generic approach for changing this.
In this interview taken during OOPSLA 2007, Markus Voelter talks about the importance of documenting the software architecture, and gives some good and also bad examples on how it could be done.
No comments
Reply