Tuesday, September 8, 2009

Although ArchJava may be too stringent to be applicable in many scenarios, it's definitely a great extension to use when starting on a new project with multiple developers. First, it encourages team members to think about designing to interfaces via connections as opposed to concrete classes. Second, it attracts programmers to think about the problem in a hierarchical manner, which often leads to a simpler design. Just look at how they first broke up the Aphyds into a simple Model and View architecture. They later broke up the View into subcomponents such as CircuitViewer, PlaceRouteViewer, ChannelRouteViewer, etc, and then broke up the AphydsModel. They didn't worry about the details until they needed to. And finally, it prevents programmers from furtively making references to classes that clearly violate the Law of Demeter. In a previous game project that I worked on with a team, it often took me a few hours to figure out root cause of a bug because there were references to model data in at least 10 different classes.

Interesting that the article discussed how they decided to persistent components for the entire execution of the program instead of having a dynamically changing architecture due to screen refresh issues. We also encountered a similar issue when the game was restarted because the code would create new instances of the model data while the View continued to hold references to the old model data. We simply decided to re-initialize the model data.

Overall, the idea behind it is great if you want to make a software architecture explicit and want to avoid unnecessary references that can lead to bugs. However, I don't think many would use it for a couple of reasons. First, its restricted to Java. Sure you can create a version of this in .NET. But what would you call it? ArchNet? And who would take the time to do this? From looking at the ArchJava home page, it seems that they stopped working on this since June 2005 so I wouldn't count on the original team. More importantly, I don't think architects would take the time to learn the ArchJava syntax since they would pretty much have to write a good chunk of code, which can be cumbersome. Maybe if they built a GUI on top of this that would automatically generate the method signatures, connections, etc., then I think there's a better chance architects would use it.

No comments:

Post a Comment