We need you!
The IzPack documentation needs work, and you are invited to edit it!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The revamp clean old style code and old patterns which are now totally obsoletes for new style code and new pattern that will be obsolete in 2 years.

Coding rules

Iterator

Don't use iterators anymore

Code Block
java

iter = collection.iterator;
while(iter.hasNext())
{
  element = iter.next();
}

Use the foreach form instead

Code Block
java

for(Element element: collection)
{
}

Singletons

Don't use singletons anymore

Code Block
java

ResourceManager.getInstance()

...

For this, you simply need to declare the component in the container

Code Block
java

pico = new PicoBuilder().withConstructorInjection().withCaching().build();
pico.addComponent(CompilerContainer.class, this);
...
pico.addComponent(ResourceManager.class);

When you need to get the instance, simply put the component as a constructor parameter

Code Block
java

public MyClass(ResourceManager resourceManager, (other dependencies) ) {
  this.resourceManager = resourceManager;
}

Package and module design

Note
titleGolden rule: no cyclic dependencies

Cyclic dependencies means that your class/package/module have bidirectionnal dependencies. Thus, you can't separate one element from the other, they are a real pain to maintenance, modularization and readability.

...

  • the Dependencies Structure Matrix of Intellij (only available on ultimate version). It is an excellent tool to analyze dependencies and help to delete cycles.
  • for Eclipse users, the ispace plugin seems to provide a way to analyze package dependencies.

Duplication

There were some duplications due to architecture limitations in the past.

...