|
----- Original Message -----
Sent: Monday, September 24, 2001 11:58
AM
Subject: Re: Task to check that the
layering and componentazing of an application is followed
Thanks Vincent,
I had a quick look and it seems to do much more
than what I was talking about.
Also it looks like it will be difficult to put in
place in the kind of environement I work in and to quiet a few environments
(stop me if I am wrong): the java language it self is changed, it has its own
compiler and debugger, etc, etc. Not all programmers are wizkids and this
looks a big step aside java.
Several things :
1/ The only thing you need is to run a
preprocessor before running the standard java tools.
2/ You don't need to ship the aspects
as part of your code for production
3/ You can separate the aspect code in
other classes so they are not mixed with your code
4/ I really think this is the best approach
for you are trying to achieve. I can tell you that without this, it will be a
nightmare to write. For example: just checking at runtime that any code that
access such interface has been through a Struts Action class would be a
nightmare without AspectJ. It is 5 lines of code with AspectJ
...
The only thing I need is something that will
organise my compilation such as it tells me I did not follow the layering that
has been agreed on during design. No touching the of the java itself. One
might be more organised in the way of organising the packages, but that
all.
Depending on what you want to achieven
you'll very soon find that you'll only be able to very simplistic checks
...
See what I mean? Or shall I elaborate further ont
he idea?
I see what you mean but you should look at
it a second time in more details. Actually you should spend one day trying it
yourself and judging by your own.
Emmanuel
-Vincent
----- Original Message -----
Sent: Monday, September 24, 2001 11:41
AM
Subject: Re: Task to check that the
layering and componentazing of an application is followed
Hi Emmanuel,
Do you mean a tool that will check that
standard practices and patterns are followed ? Like verifying (for example)
that for any use case, there is a Struts Action class, ... If this is the
case, it is very difficult to write. However, such as tool might already
exist. It is called AspectJ (and there is an Ant task for it), http://aspectj.org/. It is an addition to the
java language and offer some additional syntax to capture what is called
cross-cutting aspects. With the current Java language it is very difficult
to extract pattern rules and define them explicitely somewhere. They
are rather mixed in the different methods and there is no way to express
them.
AspectJ will let you define such patterns or
behaviours. It can be used in several ways: as a tool in the debugging phase
of program to ensure that correct rules are followed. It can also be used
during production for modifying states. See the AspectJ
tutorial.
It works by providing a compiler, which
produces java code which is then compiled by javac. All this is automated
using an Ant task if you wish.
Have a look and I'm sure you'll be amazed at
what you can do with it, as I have been. I have not used it yet but plan to
do so soon enough...
Hope it helps
-Vincent
----- Original Message -----
Sent: Monday, September 24, 2001
11:06 AM
Subject: Task to check that the
layering and componentazing of an application is followed
Hi,
Building an application by layers and
components is now a practice widely used to help having a better organised
and more maintainable code.
The trouble is, when working within teams of
5 and above, there does not seem to be a tool (correct me if I am
wrong) that will check that such layers and components are correctly build
and that the dependancies are followed.
I am thinking about building such tool based
around Ant, in form of a task or another suitable form, if there is enough
interest around.
So does anybody think like me that this is
worth it?
Emmanuel
|