Shown is an improved method and system for implementing and building
messages, such as HL7-based messages. Messages are constructed in a
format-independent manner, in which a message is built by instantiating
and linking Java classes. Metadata for the message specifications are
used to construct the Java class libraries. Signature of the classes
automatically cause the messages to be constructed with correct syntax,
structure, and restrictions. Thus, the correctness of the constructed
messages can be enforced at compile time. Moreover, a developer can
construct a specification-specific message without having to know XML.