Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > 16e567b9c4f399396e323ecd14733323 > files > 48

ant-contrib-1.0-0.12.b3.1.mga2.noarch.rpm

<html lang="en-us">

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>VerifyDesign Legacy System Tutorial</title>
</head>

<body>

<h2>VerifyDesign Legacy System Tutorial</h2>

<p>If you have a legacy system, it can be overwhelming as a typical system is a mess when it comes to package dependencies.  This tutorial shows a way to ease into the verifydesign task instead of fixing everything all at once.</p>

<p>First, in your build.xml file, use this line to verify your jar(or you can modify it to verify multiple jars)</p>

<pre>
    &lt;verifydesign jar=&quot;yourjarname.jar&quot;
                  design=&quot;design.xml&quot; 
                  /&gt;
</pre>

Now is the hardest part, go ahead and define every package and set the needDepends attribute to false for all of them so your design.xml should look like so

<pre>
  &lt;design&gt;
      &lt;package name=&quot;first&quot; package=&quot;your.first.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;second&quot; package=&quot;your.second.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;third&quot; package=&quot;your.third.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;fourth&quot; package=&quot;your.fourth.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;fifth&quot; package=&quot;your.fifth.package&quot; needDepends=&quot;false&quot;/&gt;
  &lt;/design&gt;
</pre>

Please give them better names then first, second, third, etc.  You may have 100 packages on some projects and this may take a while to get started, but keep in mind once you are done with this, you are done with the majority of the work and the build will pass once you are done with this too!

Now comes the fun part, learning about your design.  Take a package that you want to start restricting dependencies on and erase the needDepends(by default it's value will be true).  Let's take your.first.package and create the new design.xml file like so...

<pre>
  &lt;design&gt;
      &lt;package name=&quot;first&quot; package=&quot;your.first.package&quot;/&gt;
      &lt;package name=&quot;second&quot; package=&quot;your.second.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;third&quot; package=&quot;your.third.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;fourth&quot; package=&quot;your.fourth.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;fifth&quot; package=&quot;your.fifth.package&quot; needDepends=&quot;false&quot;/&gt;
  &lt;/design&gt;
</pre>

Now we run the build and we get errors that your.first.package depends on second, third, and fourth.  Let's pretend we only wanted to depend on second and third.  We then change our design file to so...

<pre>
  &lt;design&gt;
      &lt;package name=&quot;first&quot; package=&quot;your.first.package&quot;
         &lt;depends&gt;second&lt;/depends&gt;
         &lt;depends&gt;third&lt;/depends&gt;
      &lt;/package&gt;
      &lt;package name=&quot;second&quot; package=&quot;your.second.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;third&quot; package=&quot;your.third.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;fourth&quot; package=&quot;your.fourth.package&quot; needDepends=&quot;false&quot;/&gt;
      &lt;package name=&quot;fifth&quot; package=&quot;your.fifth.package&quot; needDepends=&quot;false&quot;/&gt;
  &lt;/design&gt;
</pre>

Now we run the build and clean up all the code so that first doesn't depend on fourth anymore.  This first step can typically take a full release if you are doing this in the margins.  That is ok and now forever your.first.package will only depend on second and third until the design file is changed.  You have made major progress.  I would suggest a package a release.  It can clean up dependencies and you will start finding it can be easier to add more and more features and not end up with a wad or mess on your hands.  Good luck designing.  Refactoring a legacy system can be very challenging and very long with or without this task.  This ant task guarantees that you are actually heading in your defined direction.  Whether the direction is correct or not is another story :).

<hr>
    <p align="center">Copyright &copy; 2002-2004 Ant-Contrib Project. All
    rights Reserved.</p>

</body>
</html>