You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Greg Reddin <gr...@apache.org> on 2005/12/01 18:40:29 UTC
[Standalone Tiles] Major Refactoring (Long)
I have just checked in a sweeping refactoring of the Standalone Tiles
codebase. Many may see it and immediately hurl cruise missiles in my
general direction :-) Please do, I can take it. First and foremost
however, I ask that you remember this is the sandbox. I'm just
experimenting and if people seem to think I'm drifting too far from
the original intent I am willing to unfactor what I've refactored. I
mostly did this because actual code trumps theory and I'm looking for
feedback. So please read my intent below along with a summary of
what I've done and what's left to do and let me know what you think.
My main purpose was to compress and clean up the Tiles internal API.
Every time I've looked at Tiles I've been overwhelmed by the number
of classes and interdependencies. I constantly found myself thinking
"Surely it doesn't have to be this hard". There are so many classes
and codepaths to do the same thing that there's almost certain to be
hidden features I didn't know about. Plus, the existing
documentation is terse as is the test coverage. I decided that I
either need to improve the doc and test coverage and/or take on a
major simplification effort. So I took a stab at making it simpler.
I may very well find that it does have to be that hard and be forced
to undo my changes. Here's a summary of my changes:
The object graph supporting Tiles definitions and attributes was
spread across several classes in the org/apache/tiles package. The
default implementation included what I see as a lot of core
functionality of Tiles and was contained in the org/apache/tiles/
xmlDefinition package. I compressed all of that code into the
following classes in org/apache/tiles:
ComponentDefinition
ComponentDefinitions
ComponentAttribute
ComponentListAttribute
Some of those are classes and others are implementations. There's
also a org/apache/tiles/definitions package with some
implementations. In doing this compression I was able to completely
get rid of the xmlDefinition package. I realize that xmlDefinition
represented a default xml-based implementation of the
DefinitionsFactory API So how can I justify making the default
implementation essentially part of the interface? Well, the
DefinitionsFactory interface did not inherently support some of tiles
core features like inheritance without relying on the xmlDefinition
package. I figured that if someone wants to support a different
factory, say backed by an RDBMS, they would still have to use some of
the classes in the xmlDefinition package to provide support for some
core features of Tiles.
So I moved all that functionality up to the top level. I also wrote
a default reader component that can load that object graph from XML
using Digester. To implement a database-backed factory now one
should only need to write a new reader component and the core pieces
will behave the same way.
Of course, this completely broke the taglib. So, to save time, I
simply did the poke, delete, compile, and quickly test method to make
the taglib compatible with the new core components. This works on my
simple web applications, but I'm sure the taglib is still broken in a
lot of ways.
So, what's next?
1. Taglib Refactoring.
I need to closely review the taglib, extract the core functionality,
write tests and do some of the same refactoring to the tags as I've
done to the core. However, this will not change the public interface
- only simplify the internals.
2. Test, test, test.
I've written several test cases already and need a bunch more. I'm
trying to build each feature as a test case, pretty close to the test-
first pattern. I plan to continue that approach. In fact, I'd love
it if we could just point newbies at the test cases to show Tiles'
features and how they work.
3. Refactoring Wave 3: Remove dependencies on Servlet API.
This was the original goal 3 months ago when we started down this
path. We want Ties to work in a portlet environment. Doing so will
require that we get rid of all the dependencies on Servlet components
and replace them with some sort of context object that has
implementations for both servlet and portlet APIs.
Along the way, we'll need to examine what features may have been
removed and try to figure out if and how to reimplement those. And
fix the stuff that I've broken. There's a bunch of FIXME's in the
code now that will need to be addressed.
I think this project is a pretty good candidate for Don's milestone
proposal. I can already see 2 or 3. So there. I did it. Let me
know what you think.
Thanks,
Greg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Martin Cooper <ma...@apache.org>.
On 12/1/05, Greg Reddin <gr...@apache.org> wrote:
>
> I have just checked in a sweeping refactoring of the Standalone Tiles
> codebase. Many may see it and immediately hurl cruise missiles in my
> general direction :-) Please do, I can take it. First and foremost
> however, I ask that you remember this is the sandbox. I'm just
> experimenting and if people seem to think I'm drifting too far from
> the original intent I am willing to unfactor what I've refactored. I
> mostly did this because actual code trumps theory and I'm looking for
> feedback. So please read my intent below along with a summary of
> what I've done and what's left to do and let me know what you think.
>
> My main purpose was to compress and clean up the Tiles internal API.
> Every time I've looked at Tiles I've been overwhelmed by the number
> of classes and interdependencies. I constantly found myself thinking
> "Surely it doesn't have to be this hard".
This was pretty much my reaction too, on the occasions I've delved into the
code. But I didn't have the perseverence and singlemindedness to actually
take it on and get anywhere, as you have done. Great stuff, Greg!
--
Martin Cooper
There are so many classes
> and codepaths to do the same thing that there's almost certain to be
> hidden features I didn't know about. Plus, the existing
> documentation is terse as is the test coverage. I decided that I
> either need to improve the doc and test coverage and/or take on a
> major simplification effort. So I took a stab at making it simpler.
> I may very well find that it does have to be that hard and be forced
> to undo my changes. Here's a summary of my changes:
>
> The object graph supporting Tiles definitions and attributes was
> spread across several classes in the org/apache/tiles package. The
> default implementation included what I see as a lot of core
> functionality of Tiles and was contained in the org/apache/tiles/
> xmlDefinition package. I compressed all of that code into the
> following classes in org/apache/tiles:
>
> ComponentDefinition
> ComponentDefinitions
> ComponentAttribute
> ComponentListAttribute
>
> Some of those are classes and others are implementations. There's
> also a org/apache/tiles/definitions package with some
> implementations. In doing this compression I was able to completely
> get rid of the xmlDefinition package. I realize that xmlDefinition
> represented a default xml-based implementation of the
> DefinitionsFactory API So how can I justify making the default
> implementation essentially part of the interface? Well, the
> DefinitionsFactory interface did not inherently support some of tiles
> core features like inheritance without relying on the xmlDefinition
> package. I figured that if someone wants to support a different
> factory, say backed by an RDBMS, they would still have to use some of
> the classes in the xmlDefinition package to provide support for some
> core features of Tiles.
>
> So I moved all that functionality up to the top level. I also wrote
> a default reader component that can load that object graph from XML
> using Digester. To implement a database-backed factory now one
> should only need to write a new reader component and the core pieces
> will behave the same way.
>
> Of course, this completely broke the taglib. So, to save time, I
> simply did the poke, delete, compile, and quickly test method to make
> the taglib compatible with the new core components. This works on my
> simple web applications, but I'm sure the taglib is still broken in a
> lot of ways.
>
> So, what's next?
>
> 1. Taglib Refactoring.
> I need to closely review the taglib, extract the core functionality,
> write tests and do some of the same refactoring to the tags as I've
> done to the core. However, this will not change the public interface
> - only simplify the internals.
>
> 2. Test, test, test.
> I've written several test cases already and need a bunch more. I'm
> trying to build each feature as a test case, pretty close to the test-
> first pattern. I plan to continue that approach. In fact, I'd love
> it if we could just point newbies at the test cases to show Tiles'
> features and how they work.
>
> 3. Refactoring Wave 3: Remove dependencies on Servlet API.
> This was the original goal 3 months ago when we started down this
> path. We want Ties to work in a portlet environment. Doing so will
> require that we get rid of all the dependencies on Servlet components
> and replace them with some sort of context object that has
> implementations for both servlet and portlet APIs.
>
> Along the way, we'll need to examine what features may have been
> removed and try to figure out if and how to reimplement those. And
> fix the stuff that I've broken. There's a bunch of FIXME's in the
> code now that will need to be addressed.
>
> I think this project is a pretty good candidate for Don's milestone
> proposal. I can already see 2 or 3. So there. I did it. Let me
> know what you think.
>
> Thanks,
> Greg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Joe Germuska <Jo...@Germuska.com>.
At 7:45 PM -0500 12/1/05, Laurie Harper wrote:
>Wendy Smoak wrote:
>>I'm planning to work on the Maven build. Some combination of getting
>>the version number into the filename (I think right now it should be
>>tiles-core-0.2-SNAPSHOT) and possibly adding a third piece to the
>>version number should allow us to publish snapshots that don't get
>>overwritten.
>>
>>If someone has already done this with Maven, let me know and save me
>>some reasearch. :) So far I haven't had occasion to publish/deploy a
>>build with Maven, we've just been copying the jars into the right
>>place for the internal repo.
>
>I'm no Maven guru but as far as I understand, SNAPSHOTs are
>specifically an unversioned artifact which you build and deploy with
>variants of jar:install etc. Maven will automatically ignore the
>version in project.xml and use -SNAPSHOT instead in the artifact
>file names.
>
>I expect that you could include -SNAPSHOT explicitly in project.xml,
>but it might confuse people used to the 'Maven way'. Of course you
>know Maven far better than me in general; this is just one of those
>things that always struck me about Maven. I can't see why I would
>ever want to depend on a SNAPSHOT build unless I built it myself (or
>ever want to see one in a public repository, for that matter), since
>there's no telling where it came from in terms of code history.
I generally agree with you Laurie; I find SNAPSHOT annoying because
(a) as you note you don't know its origin and (b) it makes Maven take
a lot longer every time to test for possible updates. However, for
something like nightly build code, it's the only plausible way to
keep a number of related projects together.
Certainly I think depending upon SNAPSHOT is better than depending
upon a pseudo-interim version like "1.3.0-dev", but I would tolerate
using the timestamps that are made when SNAPSHOTs are made instead of
the "symbolic" name "SNAPSHOT".
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Laurie Harper <la...@holoweb.net>.
Wendy Smoak wrote:
> I'm planning to work on the Maven build. Some combination of getting
> the version number into the filename (I think right now it should be
> tiles-core-0.2-SNAPSHOT) and possibly adding a third piece to the
> version number should allow us to publish snapshots that don't get
> overwritten.
>
> If someone has already done this with Maven, let me know and save me
> some reasearch. :) So far I haven't had occasion to publish/deploy a
> build with Maven, we've just been copying the jars into the right
> place for the internal repo.
I'm no Maven guru but as far as I understand, SNAPSHOTs are specifically
an unversioned artifact which you build and deploy with variants of
jar:install etc. Maven will automatically ignore the version in
project.xml and use -SNAPSHOT instead in the artifact file names.
I expect that you could include -SNAPSHOT explicitly in project.xml, but
it might confuse people used to the 'Maven way'. Of course you know
Maven far better than me in general; this is just one of those things
that always struck me about Maven. I can't see why I would ever want to
depend on a SNAPSHOT build unless I built it myself (or ever want to see
one in a public repository, for that matter), since there's no telling
where it came from in terms of code history.
Just my humble opinion, but I'd suggest only publishing things with a
version number or date stamp or something and letting people either
build from source or download and locally deploy a nightly if they want
something different...
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Wendy Smoak <ws...@gmail.com>.
On 12/1/05, Greg Reddin <gr...@apache.org> wrote:
> I forgot about the TLD. I haven't even looked at that yet. As for
> the website, there's really not one. I personally don't want to
> maintain two versions of the doc right now: the struts-tiles and
> Standalone. So I'm doing doc in struts-tiles and focusing on the
> parts that apply to both. If/when we merge the projects we can add/
> delete docs as needed.
I wasn't thinking of the user guide, but the the Taglibdoc, Javadoc,
CheckStyle, test coverage... all the Maven-generated reports for this
codebase.
http://struts.apache.org/struts-sandbox/tiles-core/index.html
On the version numbers... date and timestamp, or date and revision
number? I've seen artifacts named like this, and I'm assuming Maven
does it automatically. So far I haven't found out how-- 'snapshot'
and 'release' aren't the most effective search terms.
I'll go ask on users@maven and see what they suggest.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Greg Reddin <gr...@apache.org>.
On Dec 1, 2005, at 2:52 PM, Wendy Smoak wrote:
> I can also work on the TLD-- I think I was waiting for a decision on
> which attributes will be kept, but I'll go ahead and move the
> documentation into it. And, of course, publish the website.
I forgot about the TLD. I haven't even looked at that yet. As for
the website, there's really not one. I personally don't want to
maintain two versions of the doc right now: the struts-tiles and
Standalone. So I'm doing doc in struts-tiles and focusing on the
parts that apply to both. If/when we merge the projects we can add/
delete docs as needed.
Honestly, I'd be happy if the standalone codebase included nothing
but the build script and code and survived only long enough to get
the project out of the sandbox, but I'm open to suggestions.
Greg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Wendy Smoak <ws...@gmail.com>.
On 12/1/05, Craig McClanahan <cr...@apache.org> wrote:
> One thing we should probably do is talk a bit about snapshots during the
> intermediate time period while the codebase is unstable. It doesn't make
> sense to me to publish tiles-core-SNAPSHOT.jar artifacts to ibiblio.org, for
> example, since they in effect replace the previous snapshot. People who
> want bleeding edge latest and greatest code should be directed to the
> nightly builds. However, that advice is not as Maven-friendly ... so we
> probably need to balance needs here somehow.
I'm planning to work on the Maven build. Some combination of getting
the version number into the filename (I think right now it should be
tiles-core-0.2-SNAPSHOT) and possibly adding a third piece to the
version number should allow us to publish snapshots that don't get
overwritten.
If someone has already done this with Maven, let me know and save me
some reasearch. :) So far I haven't had occasion to publish/deploy a
build with Maven, we've just been copying the jars into the right
place for the internal repo.
I can also work on the TLD-- I think I was waiting for a decision on
which attributes will be kept, but I'll go ahead and move the
documentation into it. And, of course, publish the website.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Craig McClanahan <cr...@apache.org>.
On 12/2/05, Greg Reddin <gr...@apache.org> wrote:
>
>
> On Dec 2, 2005, at 12:06 AM, Wendy Smoak wrote:
>
> > People can then declare a dependency on a particular timestamped
> > snapshot, or on -SNAPSHOT in which case Maven will use the latest
> > version.
> >
> > Is this what you want to do for Stand-alone Tiles?
>
> I think this would be great. The main goal for me is to be able to
> publish milestone builds. I don't really care how they are versioned
> as long as people can see the difference.
>
> Greg
Not just *see* the difference, but *depend* on a particular versioned
artirfact. Otherwise, you can get yourself messed up as the API evolves
during the refactoring that is going on with Standalone Tiles.
Craig
---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Greg Reddin <gr...@apache.org>.
On Dec 2, 2005, at 12:06 AM, Wendy Smoak wrote:
> People can then declare a dependency on a particular timestamped
> snapshot, or on -SNAPSHOT in which case Maven will use the latest
> version.
>
> Is this what you want to do for Stand-alone Tiles?
I think this would be great. The main goal for me is to be able to
publish milestone builds. I don't really care how they are versioned
as long as people can see the difference.
Greg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Wendy Smoak <ws...@gmail.com>.
On 12/3/05, Joe Germuska <Jo...@germuska.com> wrote:
> At 11:19 PM -0700 12/2/05, Wendy Smoak wrote:
> >tiles-core-0.2-20051203.055551.jar 02-Dec-2005 21:56 82K
> >tiles-core-0.2-20051203.060733.jar 02-Dec-2005 22:07 82K
> >tiles-core-0.2-SNAPSHOT.jar 02-Dec-2005 22:07 82K
> >tiles-core-SNAPSHOT.jar 30-Aug-2005 21:27 106K
> >(plus all the signatures and metadata)
> do we want to remove tiles-core-SNAPSHOT.jar ? I'm afraid there
> might be confusion; from the listing details, it's clearly not the
> same as the other files
No. Removing that file now will break the Shale build, and it's
probably too late to change the build files and instructions for
1.0.0.
If Shale switches to a dependency on a timestamped Tiles snapshot,
then at some point we can remove that old 'unversioned' snapshot.
> I think we should disclaim any responsibility for maintaining
> specific JARs in the cvs.apache.org repository; if people are
> depending on SNAPSHOTS, they should be prepared for things possibly
> being removed. Is that fair?
I think so. Maybe a README in the directory with the Tiles snapshots
would be useful. I know that if a Maven build breaks, I browse the
repository to see what jars are available. And we do have the
sandbox/tiles-core website available, which could be used to list the
available snapshot versions with a suitable warning.
Thanks for your help with this,
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Managing Snapshots in the Maven Repo (was Re: [Standalone Tiles] Major Refactoring (Long))
Posted by Wendy Smoak <ws...@gmail.com>.
We were discussing how to handle Shale's dependency on Standalone
Tiles under this subject line, and I don't think it was ever resolved.
Maven's snapshots aren't a good fit for Shale, which needs to depend
on a reasonably stable "version" of Standalone Tiles.
In another thread, Craig wrote:
> Of course, the other approach to this problem is to do 0.1, 0.2 types of
> snapshot releases on the way towards a refactored 1.0. Then, at least, you
> can point at a dependency that is likely to be there for a while.
What if we...
- keep the 'SNAPSHOT' keyword in project.xml/pom.xml and publish
Maven snapshots for the general public to use, with no guarantees
about older snapshots being kept in the repository.
- Occasionally publish a version to the internal repository as as
0.x-dev, which is guaranteed to be kept. This is the one Shale would
depend on.
To get started, I've published a 0.2-SNAPSHOT (of r371786) to both of
the internal Maven repositories. If it works well with Shale, then we
could rename it 0.2-dev in the internal m1 repo, and move the build to
0.3-SNAPSHOT.
Alternately, we could tag and build it as 0.2, if it seems like a
better idea to handle these more like actual releases. That's more
work, though. :)
Thoughts?
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Managing Snapshots in the Maven Repo (was Re: [Standalone Tiles]
Major Refactoring (Long))
Posted by Joe Germuska <Jo...@Germuska.com>.
> > I think we should disclaim any responsibility for maintaining
>> specific JARs in the cvs.apache.org repository; if people are
>> depending on SNAPSHOTS, they should be prepared for things possibly
>> being removed. Is that fair?
>
>
>That certainly makes some logical sense ... but it has a down side too.
>Another project's trunk cannot do any useful development against the trunk
>build of Standalone Tiles at all, because there's no guarantee that I can
>download the source of the dependent project, use Maven or Ant to pull down
>the dependencies, and know that I'm going to be able to retrieve it. The
>only option would be to package the binary jar that was used (say, with this
>particular daily build) and then have to corrupt the build scripts to use
>that instead of the usual dependency.
Well, that's not my intention; I think we would intend to always
maintain at least the latest SNAPSHOT for a given version. I didn't
realize that Shale was depending on the tiles SNAPSHOT that didn't
have a version number in it and I was concerned that people might
accidentally specify "SNAPSHOT" when they meant "0.2-SNAPSHOT"
I think we want to discourage the practice of people depending on
specific timestamped versions of the JARs from their position on
cvs.apache.org, because in general we want to minimize people's
dependency on those system resources.
Thus, if there are 20 timestamped variations of
tiles-core-0.2-SNAPSHOT.jar, that we wouldn't *necessarily( keep them
all. I think adding a dependency on SNAPSHOT should indicate a
readiness to deal with possible API breakage and such, so that if an
older version is removed from the repo, the dependent code should
"catch up".
In other words, we should make it practice never to declare a
dependency on "version 0.2-20051203.060733" but rather on "version
0.2-SNAPSHOT", and we should advise other people to either do the
same or to stage the timestamped version on a Maven repository under
their own control.
How does that sound?
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Craig McClanahan <cr...@apache.org>.
On 12/3/05, Joe Germuska <Jo...@germuska.com> wrote:
>
> At 11:19 PM -0700 12/2/05, Wendy Smoak wrote:
> >On 12/2/05, Joe Germuska <Jo...@germuska.com> wrote:
> >
> >> In short, it builds a JAR with a timestamped version (like
> >> struts-core-20051106.203359.jar) and then makes a copy of it with the
> >> name struts-core-SNAPSHOT.jar So for my team, if we are depending on
> >> a nightly build, we use the timestamped version, not the SNAPSHOT, so
> >> that there is no inconsistency.
> >
> >(The artifact plugin was finally convinced to cooperate.) Before I
> >deleted them, http://cvs.apache.org/repository/tiles/jars/ had:
> >
> >tiles-core-0.2-20051203.055551.jar 02-Dec-2005 21:56 82K
> >tiles-core-0.2-20051203.060733.jar 02-Dec-2005 22:07 82K
> >tiles-core-0.2-SNAPSHOT.jar 02-Dec-2005 22:07 82K
> >tiles-core-SNAPSHOT.jar 30-Aug-2005 21:27 106K
> >(plus all the signatures and metadata)
> >
> >A Joe explained, you can declare a dependency on a particular snapshot
> >and not have to worry about Maven retrieving the latest version.
>
> do we want to remove tiles-core-SNAPSHOT.jar ? I'm afraid there
> might be confusion; from the listing details, it's clearly not the
> same as the other files (is that 24K the result of Greg's aggressive
> pruning? Nice work! ;-) )
>
> I think we should disclaim any responsibility for maintaining
> specific JARs in the cvs.apache.org repository; if people are
> depending on SNAPSHOTS, they should be prepared for things possibly
> being removed. Is that fair?
That certainly makes some logical sense ... but it has a down side too.
Another project's trunk cannot do any useful development against the trunk
build of Standalone Tiles at all, because there's no guarantee that I can
download the source of the dependent project, use Maven or Ant to pull down
the dependencies, and know that I'm going to be able to retrieve it. The
only option would be to package the binary jar that was used (say, with this
particular daily build) and then have to corrupt the build scripts to use
that instead of the usual dependency.
Of course, the other approach to this problem is to do 0.1, 0.2 types of
snapshot releases on the way towards a refactored 1.0. Then, at least, you
can point at a dependency that is likely to be there for a while.
(In case it's not obvious, the "dependent project" in this case is Shale
:-).
Joe
Craig
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Joe Germuska <Jo...@Germuska.com>.
At 11:19 PM -0700 12/2/05, Wendy Smoak wrote:
>On 12/2/05, Joe Germuska <Jo...@germuska.com> wrote:
>
>> In short, it builds a JAR with a timestamped version (like
>> struts-core-20051106.203359.jar) and then makes a copy of it with the
>> name struts-core-SNAPSHOT.jar So for my team, if we are depending on
>> a nightly build, we use the timestamped version, not the SNAPSHOT, so
>> that there is no inconsistency.
>
>(The artifact plugin was finally convinced to cooperate.) Before I
>deleted them, http://cvs.apache.org/repository/tiles/jars/ had:
>
>tiles-core-0.2-20051203.055551.jar 02-Dec-2005 21:56 82K
>tiles-core-0.2-20051203.060733.jar 02-Dec-2005 22:07 82K
>tiles-core-0.2-SNAPSHOT.jar 02-Dec-2005 22:07 82K
>tiles-core-SNAPSHOT.jar 30-Aug-2005 21:27 106K
>(plus all the signatures and metadata)
>
>A Joe explained, you can declare a dependency on a particular snapshot
>and not have to worry about Maven retrieving the latest version.
do we want to remove tiles-core-SNAPSHOT.jar ? I'm afraid there
might be confusion; from the listing details, it's clearly not the
same as the other files (is that 24K the result of Greg's aggressive
pruning? Nice work! ;-) )
I think we should disclaim any responsibility for maintaining
specific JARs in the cvs.apache.org repository; if people are
depending on SNAPSHOTS, they should be prepared for things possibly
being removed. Is that fair?
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Wendy Smoak <ws...@gmail.com>.
On 12/2/05, Joe Germuska <Jo...@germuska.com> wrote:
> In short, it builds a JAR with a timestamped version (like
> struts-core-20051106.203359.jar) and then makes a copy of it with the
> name struts-core-SNAPSHOT.jar So for my team, if we are depending on
> a nightly build, we use the timestamped version, not the SNAPSHOT, so
> that there is no inconsistency.
(The artifact plugin was finally convinced to cooperate.) Before I
deleted them, http://cvs.apache.org/repository/tiles/jars/ had:
tiles-core-0.2-20051203.055551.jar 02-Dec-2005 21:56 82K
tiles-core-0.2-20051203.060733.jar 02-Dec-2005 22:07 82K
tiles-core-0.2-SNAPSHOT.jar 02-Dec-2005 22:07 82K
tiles-core-SNAPSHOT.jar 30-Aug-2005 21:27 106K
(plus all the signatures and metadata)
A Joe explained, you can declare a dependency on a particular snapshot
and not have to worry about Maven retrieving the latest version.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Wendy Smoak <ws...@gmail.com>.
On 12/2/05, Joe Germuska <Jo...@germuska.com> wrote:
> That is, using "maven jar:deploy-snapshot", you can build and deploy
> a SNAPSHOT library independent of the <version> in the POM.
> Similarly with jar:install-snapshot, dist:deploy-snapshot, etc.
>
> In short, it builds a JAR with a timestamped version (like
> struts-core-20051106.203359.jar) and then makes a copy of it with the
> name struts-core-SNAPSHOT.jar So for my team, if we are depending on
> a nightly build, we use the timestamped version, not the SNAPSHOT, so
> that there is no inconsistency.
I just checked in these changes. (Thanks, Joe!)
But I can't get jar:deploy to work. It keeps insisting that I have to
provide a private key, and I'm sure that I'm giving it the right path
and filename. I can ssh or scp to people.apache.org with no password,
so I know the keys are okay.
Can someone else please try it? There's a sample build.properties
file, either use that or put the properties on the command line, then:
$ maven jar:deploy -Dmaven.repo.list=apache
If it doesn't work, you can also change the dependency to 1.5.2 for
the artifact plugin. That's the one Brett suggested, but the docs say
it requires Maven 1.1.
Let me know what happens... I'll go triple check that I'm using the right key.
Thanks,
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Joe Germuska <Jo...@Germuska.com>.
At 11:06 PM -0700 12/1/05, Wendy Smoak wrote:
>On 12/1/05, Joe Germuska <Jo...@germuska.com> wrote:
>
>> I think we could publish nightly (or intermittent) snapshots to the
>> Apache repository (http://cvs.apache.org/repository/) I think that
>> the hope is to avoid people treating it like an ibiblio mirror (i.e.
>> we would only publish snapshots and things of lower interest) but
>> that it exists to fill that niche.
>>
>> You can do this by configuring a set of properties like these:
>>
>> # Apache repository
>> maven.repo.apache=scp://people.apache.org
>> maven.repo.apache.directory=/www/cvs.apache.org/repository
>> maven.repo.apache.group=apcvs
>> maven.repo.apache.username=germuska
>> maven.repo.apache.privatekey=/Users/germuska/.ssh/id_rsa
>>
>> (which your username and path to private key adjusted as appropriate)
>>
>> and then using maven jar:deploy -Dmaven.repo.list=apache
>
>Brett answered within minutes. :) I didn't know this... if you have
>"SNAPSHOT" in the version number, when you do as Joe suggests and
>deploy the jar, that's when Maven inserts the date and timestamp.
I'm not sure if that's how it works; at least, the "preferred way" to
make a snapshot build is to use alternate goals, not just depend on
the version number.
That is, using "maven jar:deploy-snapshot", you can build and deploy
a SNAPSHOT library independent of the <version> in the POM.
Similarly with jar:install-snapshot, dist:deploy-snapshot, etc.
In short, it builds a JAR with a timestamped version (like
struts-core-20051106.203359.jar) and then makes a copy of it with the
name struts-core-SNAPSHOT.jar So for my team, if we are depending on
a nightly build, we use the timestamped version, not the SNAPSHOT, so
that there is no inconsistency. But in the actual POMs, we should
use SNAPSHOT so as to not need to repeatedly tweak the POM files and
deploy specific new snapshots (and to make automated nightly builds
truly depend upon the newest of each.)
If people don't like the repeated maven-checking-for-newer-snapshot,
they can use "maven -o" or they can use the "maven.jar.override"
property (along with some others) to specify specific non-SNAPSHOT
versions.
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Wendy Smoak <ws...@gmail.com>.
On 12/1/05, Joe Germuska <Jo...@germuska.com> wrote:
> I think we could publish nightly (or intermittent) snapshots to the
> Apache repository (http://cvs.apache.org/repository/) I think that
> the hope is to avoid people treating it like an ibiblio mirror (i.e.
> we would only publish snapshots and things of lower interest) but
> that it exists to fill that niche.
>
> You can do this by configuring a set of properties like these:
>
> # Apache repository
> maven.repo.apache=scp://people.apache.org
> maven.repo.apache.directory=/www/cvs.apache.org/repository
> maven.repo.apache.group=apcvs
> maven.repo.apache.username=germuska
> maven.repo.apache.privatekey=/Users/germuska/.ssh/id_rsa
>
> (which your username and path to private key adjusted as appropriate)
>
> and then using maven jar:deploy -Dmaven.repo.list=apache
Brett answered within minutes. :) I didn't know this... if you have
"SNAPSHOT" in the version number, when you do as Joe suggests and
deploy the jar, that's when Maven inserts the date and timestamp.
People can then declare a dependency on a particular timestamped
snapshot, or on -SNAPSHOT in which case Maven will use the latest
version.
Is this what you want to do for Stand-alone Tiles?
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Joe Germuska <Jo...@Germuska.com>.
>One thing we should probably do is talk a bit about snapshots during the
>intermediate time period while the codebase is unstable. It doesn't make
>sense to me to publish tiles-core-SNAPSHOT.jar artifacts to ibiblio.org, for
>example, since they in effect replace the previous snapshot. People who
>want bleeding edge latest and greatest code should be directed to the
>nightly builds. However, that advice is not as Maven-friendly ... so we
>probably need to balance needs here somehow.
I think we could publish nightly (or intermittent) snapshots to the
Apache repository (http://cvs.apache.org/repository/) I think that
the hope is to avoid people treating it like an ibiblio mirror (i.e.
we would only publish snapshots and things of lower interest) but
that it exists to fill that niche.
You can do this by configuring a set of properties like these:
# Apache repository
maven.repo.apache=scp://people.apache.org
maven.repo.apache.directory=/www/cvs.apache.org/repository
maven.repo.apache.group=apcvs
maven.repo.apache.username=germuska
maven.repo.apache.privatekey=/Users/germuska/.ssh/id_rsa
(which your username and path to private key adjusted as appropriate)
and then using maven jar:deploy -Dmaven.repo.list=apache
People who wanted to depend on the SNAPSHOT would need to make sure
that the "maven.repo.remote" property included
"http://cvs.apache.org/repository/" in its value-list. I think we'd
want to encourage people to use this sparingly (i.e. don't put it in
~/build.properties).
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Greg Reddin <gr...@apache.org>.
On Dec 1, 2005, at 2:15 PM, Craig McClanahan wrote:
> One thing we should probably do is talk a bit about snapshots
> during the
> intermediate time period while the codebase is unstable. It
> doesn't make
> sense to me to publish tiles-core-SNAPSHOT.jar artifacts to
> ibiblio.org, for
> example, since they in effect replace the previous snapshot.
> People who
> want bleeding edge latest and greatest code should be directed to the
> nightly builds. However, that advice is not as Maven-friendly ...
> so we
> probably need to balance needs here somehow.
The version number right now is 0.2-dev. I'm not really sure where
that came from. We could publish last night's build as 0.2-dev and
tonight's build as 0.3-dev. Then we can publish a roadmap with
milestones and increment the minor version number when a milestone is
reached. At the end of the process we'll be able to release a 1.0.0
and get on a more standard release process.
I see the value in keeping older milestones around. Other projects
like MyFaces might want to base their dependencies on those and
upgrade at will. I'd hate for them to be dependent on a version that
gets updated every night and breaks on a regular basis.
Greg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Craig McClanahan <cr...@apache.org>.
On 12/1/05, Greg Reddin <gr...@apache.org> wrote:
>
>
> On Dec 1, 2005, at 1:47 PM, Sean Schofield wrote:
>
> > I can't believe how much you like to punish yourself! Is anyone else
> > helping you with this massive effort?
>
> Well, I brought this on myself :-) I've been a big fan of Tiles ever
> since I first used it. When people started talking about packaging
> up Standalone Tiles and we have this "window of opportunity" to make
> changes I kinda pounced on it. Then, of course, it started to get
> out of hand.
+1 to the direction, and thanks for all the efforts.
One thing we should probably do is talk a bit about snapshots during the
intermediate time period while the codebase is unstable. It doesn't make
sense to me to publish tiles-core-SNAPSHOT.jar artifacts to ibiblio.org, for
example, since they in effect replace the previous snapshot. People who
want bleeding edge latest and greatest code should be directed to the
nightly builds. However, that advice is not as Maven-friendly ... so we
probably need to balance needs here somehow.
Craig
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Greg Reddin <gr...@apache.org>.
On Dec 1, 2005, at 1:47 PM, Sean Schofield wrote:
> I can't believe how much you like to punish yourself! Is anyone else
> helping you with this massive effort?
Well, I brought this on myself :-) I've been a big fan of Tiles ever
since I first used it. When people started talking about packaging
up Standalone Tiles and we have this "window of opportunity" to make
changes I kinda pounced on it. Then, of course, it started to get
out of hand.
The huge commit that happened earlier only represents about 8 hours
of work, but it took me about 2 months to do it :-) I only checked
it in today as a request for help. It's broken. It will build and
even run in a simple web app I've tested it on, but I guarantee you
the taglib is likely in sad shape. I just commented out code until
it would compile and was completely floored when my app still ran
without errors :-) But I'm hoping people will find those errors and
present solutions, not to mention suggestions on the sweeping changes
I've made.
Anyway, maybe now we're far enough along I can wiki up a roadmap and
there will be a more definitive set of things for willing hands to do.
Greg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Sean Schofield <se...@gmail.com>.
I can't believe how much you like to punish yourself! Is anyone else
helping you with this massive effort? I'd offer to help but my
workload is at about 250% capacity right now.
When things stablize I'll take things for a spin in Shale.
sean
On 12/1/05, Greg Reddin <gr...@apache.org> wrote:
> I have just checked in a sweeping refactoring of the Standalone Tiles
> codebase. Many may see it and immediately hurl cruise missiles in my
> general direction :-) Please do, I can take it. First and foremost
> however, I ask that you remember this is the sandbox. I'm just
> experimenting and if people seem to think I'm drifting too far from
> the original intent I am willing to unfactor what I've refactored. I
> mostly did this because actual code trumps theory and I'm looking for
> feedback. So please read my intent below along with a summary of
> what I've done and what's left to do and let me know what you think.
>
> My main purpose was to compress and clean up the Tiles internal API.
> Every time I've looked at Tiles I've been overwhelmed by the number
> of classes and interdependencies. I constantly found myself thinking
> "Surely it doesn't have to be this hard". There are so many classes
> and codepaths to do the same thing that there's almost certain to be
> hidden features I didn't know about. Plus, the existing
> documentation is terse as is the test coverage. I decided that I
> either need to improve the doc and test coverage and/or take on a
> major simplification effort. So I took a stab at making it simpler.
> I may very well find that it does have to be that hard and be forced
> to undo my changes. Here's a summary of my changes:
>
> The object graph supporting Tiles definitions and attributes was
> spread across several classes in the org/apache/tiles package. The
> default implementation included what I see as a lot of core
> functionality of Tiles and was contained in the org/apache/tiles/
> xmlDefinition package. I compressed all of that code into the
> following classes in org/apache/tiles:
>
> ComponentDefinition
> ComponentDefinitions
> ComponentAttribute
> ComponentListAttribute
>
> Some of those are classes and others are implementations. There's
> also a org/apache/tiles/definitions package with some
> implementations. In doing this compression I was able to completely
> get rid of the xmlDefinition package. I realize that xmlDefinition
> represented a default xml-based implementation of the
> DefinitionsFactory API So how can I justify making the default
> implementation essentially part of the interface? Well, the
> DefinitionsFactory interface did not inherently support some of tiles
> core features like inheritance without relying on the xmlDefinition
> package. I figured that if someone wants to support a different
> factory, say backed by an RDBMS, they would still have to use some of
> the classes in the xmlDefinition package to provide support for some
> core features of Tiles.
>
> So I moved all that functionality up to the top level. I also wrote
> a default reader component that can load that object graph from XML
> using Digester. To implement a database-backed factory now one
> should only need to write a new reader component and the core pieces
> will behave the same way.
>
> Of course, this completely broke the taglib. So, to save time, I
> simply did the poke, delete, compile, and quickly test method to make
> the taglib compatible with the new core components. This works on my
> simple web applications, but I'm sure the taglib is still broken in a
> lot of ways.
>
> So, what's next?
>
> 1. Taglib Refactoring.
> I need to closely review the taglib, extract the core functionality,
> write tests and do some of the same refactoring to the tags as I've
> done to the core. However, this will not change the public interface
> - only simplify the internals.
>
> 2. Test, test, test.
> I've written several test cases already and need a bunch more. I'm
> trying to build each feature as a test case, pretty close to the test-
> first pattern. I plan to continue that approach. In fact, I'd love
> it if we could just point newbies at the test cases to show Tiles'
> features and how they work.
>
> 3. Refactoring Wave 3: Remove dependencies on Servlet API.
> This was the original goal 3 months ago when we started down this
> path. We want Ties to work in a portlet environment. Doing so will
> require that we get rid of all the dependencies on Servlet components
> and replace them with some sort of context object that has
> implementations for both servlet and portlet APIs.
>
> Along the way, we'll need to examine what features may have been
> removed and try to figure out if and how to reimplement those. And
> fix the stuff that I've broken. There's a bunch of FIXME's in the
> code now that will need to be addressed.
>
> I think this project is a pretty good candidate for Don's milestone
> proposal. I can already see 2 or 3. So there. I did it. Let me
> know what you think.
>
> Thanks,
> Greg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [Standalone Tiles] Major Refactoring (Long)
Posted by Rahul Akolkar <ra...@gmail.com>.
On 12/1/05, Greg Reddin <gr...@apache.org> wrote:
<snip/>
>
> Anyway, maybe now we're far enough along I can wiki up a
> roadmap and there will be a more definitive set of things for
> willing hands to do.
>
<snap/>
I must echo Sean's comments, and thanks for the efforts! IMO, this
wiki page will be a good thing. There may be folks willing to help
with the test cases, documentation and even with suggestions about the
taglib (internal) API changes if you can break them down on the wiki.
One of the things that prevents participation is not knowing if you're
duplicating effort ;-)
-Rahul
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org