This is the first in a series of blog entries where I'll talk about a list of things I'd like to see added to the Java platform (SE) if I had my "druthers" - usually things I end up writing myself but which are pretty generic and that I think should be part of the platform.
You know the situation, you update some data in the database and then one or more components / objects within the same JVM need to be informed of this state change in data so they can perform some action or just be in synch.
"OK", you say, "let's use the Pub-Sub / Observer pattern". So you start off hard-coding these linkages to begin with. That's fine, not a big problem, but now another component comes along and another and you need decide to put the connectivity in a config file or store this linkage in a database somewhere so it can be more dynamic.
OK not so bad, but now all of a sudden other applications in other domains or on other servers need to know about this data state change so you need some inter-application communication (e.g. shared database with polling/triggers or JMS or perhaps something like Tangosol Coherence).
Typically in such situations I've used something that is messaging-based (for scalability) and topic-oriented (to allow decoupling of publishers from subscribers) - Tibco Rendezvous comes to mind.
But here's the thing - isn't this such a common piece of functionality that we should get some kind of support out of the box from Java SE? As I've said before, but not really discussed on this forum, I've thought that SE should come with a JMS provider built-in. Messaging is so fundamental to many modern day applications I think it should come as built-in standard (similar to how Web Services are now part of SE)
So now think of this - put a hook-into JDBC to broadcast data changes it sees e.g. something like
someJDBCclass.addDataChangeBroadcaster(String jmsTopic, String tableName, String columnName);
Which, if it sees a change to the data stored in a particular column in a particular table, will
broadcast that change (either some small little XML message or a simple tag=value pair) to a particular JMS topic.
On the subscriber-side you'd have some MessageListener class or similar that would subscribe to that topic and then do something based on the result.
Perhaps you could even do
someJDBCclass.addDataChangeBroadcaster("com.frank.mytopic", "mytable", "*")
which would broadcast changes to any column on that table and then on the subscriber side you could have
createDataChangeListener(this,"com.frank.mytopic");
to listen to all changes or
createDataChangeListener(this,"com.frank.mytopic.mytable.mycolumn");
to listen to just changes to particular columns.
[OK I've ended up tying my subscribers to the data model but we can get around that in various easy ways]
But this is pretty core functionality that I would love to see out of the box in Java SE/EE so I could stop having to create such frameworks everywhere I go. And typically what happens is you have to go into every piece of code that touches those tables and add a check if changed and a "broadcast" step.
I'd like to declare things once ("tell me if field X changes") kind of way. Oracle TopLink, other ORM frameworks and, like I mentioned previously, Coherence have such capabilities but I think this is the very stuff that should be available on the platform.
What do you think? When you change data and update information what things do you find yourself writing code for again and again?
My thoughts on best practices in software architecture and development as a whole (with an emphasis on the Java stack).
3/19/07
3/4/07
RFC: What is your ideal development environment?
Naturally there will be differences with other folks, but here's my current "ideal" development environment and I'd appreciate comments or feedback, alternatives etc. What's your ideal dev env?
It has taken a number of years to finally settle on a suite of Development tools that I like and am (finally) quite used to
IDE:
Eclipse 3.2.2
(prior to 2005 I was mostly using JBuilder waiting until Eclipse 3.0 became fast enough to be usable and ant integration became good)
Plug-ins:
- Checkstyle for Eclipse 4.2
- EclEmma 1.1 for Code Coverage while Unit testing
I'm just starting getting up to speed on using the latest WTP (Web Tools Platform) and TPTP (Test and Performance Tools Platform) releases from a recent release of Callisto.
Container Environment
1) Tomcat - well there could be only one - WebSphere is just too clunky and I've not used WebLogic. I tried Geronimo a while back in '06 but the lack of documentation / tutorials stopped me cold. Hopefully it will get better.
2) Others I'd like to play with - JBoss are going great with the addition of things like Drools and Glassfish seems to be coming on strong too. It certainly appears that the open source oriented containers are far outstripping the commercial boys in terms of features and functionality.
Other Key Tools
1) Automation: Apache Ant
2) Modeling: StarUML (just found this on a recommendation from a comment on this blog - it rocks)
3) General Scripting: For most simple things KSH, beyond that Perl.
4) Test Tools:
- JUnit
- Cactus
- HttpUnit
5) External Code Report Tools (integrated with Ant)
- Checkstyle 4.2
- PMD 3.8
- FindBugs 1.1
- JDepend 2.9.1
- And good ole Javadoc
Why use three different code checkers - Checkstyle, PMD and FindBugs? They find different bugs and potential problems. See my blog "Analyze This - Put your code on the couch!" for more details.
Source-code control is pretty much up to my employer, so over the years I've used
1) CVS (very basic)
2) Microsoft's Visual Source Safe (very basic and couldn't really scale)
3) IBM Rational Clearcase (very complete but such a hog)
4) Perforce (just about right)
Haven't used Subversion yet :-(
Gotta say I really am impressed by Perforce – primarily how fast and scalable it is and for the way it lets you group checked-out files together into so-called "change-lists" and am surprised the product doesn't get more attention (although I learned that Google uses it quite a bit and that gives it a well deserved buzz). Subversion clearly is very hot right now but haven't had a good reason to use it yet to compare.
WISH LIST
1) More and better Ant integration with Eclipse- I wish Eclipse could easily extract (dynamic - property drive) classpaths from Ant
2) StarUML integration with Eclipse (the existing free UML plugins out there aren't great)
3) Faster PMD plugin for Eclipse (it takes about 10 times as long to run as Checkstyle but it finds some good problems)
4) I wish I had some time and money to buy a subscription MyEclipse :-)
Any other good tools I should know about and be aware of? IntelliJ continues to get rave reviews from individual Java developers and I've never tried it - is the cost worth it when compared with Eclipse?
p.s. speaking of tools, IBM Developerworks just had a great article entitled "Selecting the best tools for your software system design", yes it has an IBM leaning but also references a few open source tools I wasn't aware of, particularly OSRMT and TestLink.
It has taken a number of years to finally settle on a suite of Development tools that I like and am (finally) quite used to
IDE:
Eclipse 3.2.2
(prior to 2005 I was mostly using JBuilder waiting until Eclipse 3.0 became fast enough to be usable and ant integration became good)
Plug-ins:
- Checkstyle for Eclipse 4.2
- EclEmma 1.1 for Code Coverage while Unit testing
I'm just starting getting up to speed on using the latest WTP (Web Tools Platform) and TPTP (Test and Performance Tools Platform) releases from a recent release of Callisto.
Container Environment
1) Tomcat - well there could be only one - WebSphere is just too clunky and I've not used WebLogic. I tried Geronimo a while back in '06 but the lack of documentation / tutorials stopped me cold. Hopefully it will get better.
2) Others I'd like to play with - JBoss are going great with the addition of things like Drools and Glassfish seems to be coming on strong too. It certainly appears that the open source oriented containers are far outstripping the commercial boys in terms of features and functionality.
Other Key Tools
1) Automation: Apache Ant
2) Modeling: StarUML (just found this on a recommendation from a comment on this blog - it rocks)
3) General Scripting: For most simple things KSH, beyond that Perl.
4) Test Tools:
- JUnit
- Cactus
- HttpUnit
5) External Code Report Tools (integrated with Ant)
- Checkstyle 4.2
- PMD 3.8
- FindBugs 1.1
- JDepend 2.9.1
- And good ole Javadoc
Why use three different code checkers - Checkstyle, PMD and FindBugs? They find different bugs and potential problems. See my blog "Analyze This - Put your code on the couch!" for more details.
Source-code control is pretty much up to my employer, so over the years I've used
1) CVS (very basic)
2) Microsoft's Visual Source Safe (very basic and couldn't really scale)
3) IBM Rational Clearcase (very complete but such a hog)
4) Perforce (just about right)
Haven't used Subversion yet :-(
Gotta say I really am impressed by Perforce – primarily how fast and scalable it is and for the way it lets you group checked-out files together into so-called "change-lists" and am surprised the product doesn't get more attention (although I learned that Google uses it quite a bit and that gives it a well deserved buzz). Subversion clearly is very hot right now but haven't had a good reason to use it yet to compare.
WISH LIST
1) More and better Ant integration with Eclipse- I wish Eclipse could easily extract (dynamic - property drive) classpaths from Ant
2) StarUML integration with Eclipse (the existing free UML plugins out there aren't great)
3) Faster PMD plugin for Eclipse (it takes about 10 times as long to run as Checkstyle but it finds some good problems)
4) I wish I had some time and money to buy a subscription MyEclipse :-)
Any other good tools I should know about and be aware of? IntelliJ continues to get rave reviews from individual Java developers and I've never tried it - is the cost worth it when compared with Eclipse?
p.s. speaking of tools, IBM Developerworks just had a great article entitled "Selecting the best tools for your software system design", yes it has an IBM leaning but also references a few open source tools I wasn't aware of, particularly OSRMT and TestLink.
Labels:
Apache Ant,
java,
Software,
tools
I still love Ant
After reading Jim Crossley's blog "Hating Maven less than Ant" I did a little thinking and reminiscing . . . . . Ant is almost certainly no longer in the ascendant with Maven making more in-roads but I still see more Ant than Maven in industry.
I fell in love with Ant back in 2002 when I found I could very quickly and easily plug in other tools such as Checkstyle, PMD, JUnit etc. especially with the help of one of my favorite books "Java Development with Ant"
Let me also address a few points from Jim's blog
1) "XML, which should never be used as a programming language "
Ant is really a souped up version of "make" which was declarative in nature - so is XML - prescribing "what" to do, not "how". But for most folks, it's true, eventually we end up writing "how" stuff (procedural things) for the more complex things - but still XML is not too bad as most ant tasks should be pretty small / modular and reusable.
2) "Ant allows you to describe your build however you please, but you must effectively do it from scratch for each project"
That's not necessarily true, back in '03 I created a re-usable ant library for all the basic things you need to run (clean, compile, test, checkstyle, create reports, email files etc.) and it's configurable via a property file. Hey if you keep the same basic project folder structure (standardization is not a bad thing) then you could re-use it only changing one property - the name of the project since all paths were relative.
But yes, in general, Maven is apparently more easily re-usable. I haven't really used Maven enough to know - I tried in '04 to follow a Maven tutorial and found it so complex (compared to Ant) that it scared me off and I haven't been back. Now that I see the Maven 2 snippet in Jim's blog I think complexity just went up even further. Hopefully I'm wrong - more competition in this space isn't a bad thing.
Furthermore until Eclipse integration with Ant improved I didn't make the jump to Eclipse and stuck with my company's prescribed IDE (JBuilder / WSAD).
Anyway this is a note to say, I guess, that my love for Ant is still strong - it has made my life as a developer and architect easier for many years now and, although showing her age a little, it is still the "little engine that could". I contrast that with Eclipse - so many dependencies to resolve yourself - bugs preventing me from easily upgrading. A great tool and getting better but not without it's cost in time and effort configuring, recovering workspaces etc.
For those of you using Ant already I can't stress enough how useful the book "Java Development with Ant" has been and continues to be. For those not using Ant or Maven you really are missing out on some powerful tools? Are there any alternatives I should know about?
I fell in love with Ant back in 2002 when I found I could very quickly and easily plug in other tools such as Checkstyle, PMD, JUnit etc. especially with the help of one of my favorite books "Java Development with Ant"
Let me also address a few points from Jim's blog
1) "XML, which should never be used as a programming language "
Ant is really a souped up version of "make" which was declarative in nature - so is XML - prescribing "what" to do, not "how". But for most folks, it's true, eventually we end up writing "how" stuff (procedural things) for the more complex things - but still XML is not too bad as most ant tasks should be pretty small / modular and reusable.
2) "Ant allows you to describe your build however you please, but you must effectively do it from scratch for each project"
That's not necessarily true, back in '03 I created a re-usable ant library for all the basic things you need to run (clean, compile, test, checkstyle, create reports, email files etc.) and it's configurable via a property file. Hey if you keep the same basic project folder structure (standardization is not a bad thing) then you could re-use it only changing one property - the name of the project since all paths were relative.
But yes, in general, Maven is apparently more easily re-usable. I haven't really used Maven enough to know - I tried in '04 to follow a Maven tutorial and found it so complex (compared to Ant) that it scared me off and I haven't been back. Now that I see the Maven 2 snippet in Jim's blog I think complexity just went up even further. Hopefully I'm wrong - more competition in this space isn't a bad thing.
Furthermore until Eclipse integration with Ant improved I didn't make the jump to Eclipse and stuck with my company's prescribed IDE (JBuilder / WSAD).
Anyway this is a note to say, I guess, that my love for Ant is still strong - it has made my life as a developer and architect easier for many years now and, although showing her age a little, it is still the "little engine that could". I contrast that with Eclipse - so many dependencies to resolve yourself - bugs preventing me from easily upgrading. A great tool and getting better but not without it's cost in time and effort configuring, recovering workspaces etc.
For those of you using Ant already I can't stress enough how useful the book "Java Development with Ant" has been and continues to be. For those not using Ant or Maven you really are missing out on some powerful tools? Are there any alternatives I should know about?
Labels:
Apache Ant,
Maven,
XML
Subscribe to:
Posts (Atom)