MetaBundles can seamlessly map to Java packages and classes through their
names because of the simular naming convention. So the best solution is also
intuitive:
To associate localizable information to Java packages
and classes is by fetching these information as metadata from a MetaBundle associated
with the package or class in question.
And there are several key points to support, where Meta Facility is also
good at:
-
- Easy To Write
- Meta Facility loads metadata from plain XML files. XML is human
readable as well as friendly to software editing tools. The authors have
wide freedom to choose from plain text editors to complicated and powerful
XML authoring toolkits.
-
- Easy To Localize
- An author can just copy an XML file for another locale to a new
file for his target locale, just change the
Locale Meta ID in the file name and right start translation.
-
- Workpiece Isolation
- XML files carring metadata exist per MetaBundle per Locale in
MetaFacility, this means each package or class can have a separated XML
file for each locale. You can assign a work unit as small as annotating a
single package or class.
-
- Easy Assembling
- Several people's collective works assemble naturally by putting
them into a single directory, since they are XML files won't overwrite
each other.
And another solution, better for increamental development in team
collaboration, you can set the classpath to include each one's base
working directory (can also be packed jar files, mounted NFS directory, or
even base URLs) as an entry. Such that everyone's latest work can be
transparently loaded and seen.
Note you don't have to stick with the
Java classpath mechanism, you can use
CompositeLoader to composite mutiple
FileSystemLoader and other
MetaLoader instances, it will work as well and give you more control and
flexibility. But the Brief Demo just use the default Java classpath
MetaRepository for simplicity and easy understanding.
-
- Refresh Without Restart
- Meta Facility just provides this ability. Either invoke
MetaBundle.reload() to reload a particular MetaBundle, or invoke
MetaRepository.reload() against a MetaRepository to reload all
MetaBundles ever loaded from it.