<!-- <questionid="arch-overall"when="init"> Describetheoverallarchitecture. <hint> WhatwillbeAPIfor <ahref="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi"> clientsandwhatsupportAPI</a>? Whatpartswillbepluggable? Howwillplug-insberegistered?Pleaseuse<code><apitype="export"/></code> todescribeyourgeneralAPIs. Ifpossiblepleaseprovide simplediagrams. </hint> </question>
-->
<answer id="arch-overall">
<p>
<api type="export" name="XDM" group="java" category="devel">XDM (XML Document Model)</api> provides a XAM based full fidelity XML model which
implements the org.w3c.dom interfaces. The intention is not to provide an
an alternate implementation of the dom interfaces but only to reuse part of
the api where it makes sense and more importantly provide a foundation on
which to provide a model basis for graphical multi way editors.
</p>
This module was developed to support the following requirements:
<ul>
<li>Full document fidelity. This allows the original document to be
preserved and only changes the actual sections of the document which
were mutated (i.e. the transformation is lossless).</li>
<li>Support for undo/redo in a memory efficient way</li>
<li>Support for diff to allow changes to be detected in
the underlying source</li>
<li>Visitor support</li>
</ul>
</answer>
<!-- <questionid="arch-quality"when="init"> Howwillthe<ahref="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> ofyourcodebetestedand howarefutureregressionsgoingtobeprevented? <hint> Whatkindoftestingdo youwanttouse?Howmuchfunctionality,inwhichareas, shouldbecoveredbythetests? </hint> </question>
-->
<answer id="arch-quality">
<p>
This module is covered by JUnit tests and findBugs has been incorporated into
the development process. This module is the core of most of the domain
models and is extensively covered.
</p>
</answer>
<!-- <questionid="arch-time"when="init"> Whatarethetimeestimatesofthework? <hint> Pleaseexpressyourestimatesofhowlongthedesign,implementation, stabilizationarelikelytolast.Howmanypeoplewillbeneededto implementthisandwhatistheexpectedmilestonebywhichtheworkshouldbe ready? </hint> </question>
-->
<answer id="arch-time">
<p>
This module is implementation complete, but will require additional effort
for ongoing maintenence in conjunction with the other modules.
</p>
</answer>
<!-- <questionid="arch-usecases"when="init"> <hint> Contentofthisanswerwillbedisplayedaspartofpageat http://www.netbeans.org/download/dev/javadoc/usecases.html Youcanusetags<usecasename="name>regularhtmldescription</usecase> andifyouwanttouseanURLyoucanprefixifwith@TOP@tobegin attherootofyourjavadoc </hint> Describethemain<ahref="http://openide.netbeans.org/tutorial/api-design.html#usecase"> usecases</a>ofthenewAPI.Whowilluseitunder whatcircumstances?Whatkindofcodewouldtypicallyneedtobewritten tousethemodule? </question>
-->
<answer id="arch-usecases">
The typical client of XDM would be a tool author supporting an XMLlanguage
who wants to provide a custom client API. A concrete example of this is the XML
Schema model. The XML Schema model starts by subclassing AbstractXDMModel and
providing the component updater, which is called in conjunction with sync
to mutate the model according to changes in the underlying source.
<usecase id="uc1" name="WSDL model">
The WSDL model is based on the XDM model and relies on the XDM capabilities
to provide the infrastructure necessary for providing a XAM based model.
</usecase>
<usecase id="uc2" name="Schema model">
The Schema model is based on the XDM model and relies on the XDM capabilities
to provide the infrastructure necessary for providing a XAM based model.
</usecase>
<usecase id="uc3" name="BPEL model">
The BPEL model is based on the XDM model and relies on the XDM capabilities
to provide the infrastructure necessary for providing a XAM based model.
</usecase>
The XDM model can be used in standalone mode.
<code> <br/><br/>
BaseDocument sd = ...;
<br/>
Lookup lookup = Lookups.singleton(sd);
<br/>
// create an editable ModelSource with base document
<br/>
// in the lookup (this is required)
<br/>
ModelSource ms = new ModelSource(lookup, true);
<br/>
// create an XDMModel
<br/>
XDMModel model = new XDMModel(ms);
<br/>
// sync the XDM model with the underlying source
<br/>
model.sync();
<br/>
// create customer element, same as dom
<br/> Element customer = model.getDocument().createElement("customer");
<br/>
// add to the model as 0th child of employee element, not shown
<br/>
model.add(employee,customer,0);
<br/>
</code>
</answer>
<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
The XDM module provides a basis for tool ready XMLlanguage models that require full
document fidelity, undo/redo, and the ability to sync with the underlying source.
<p>List of the main features:</p>
<ul>
<li>Support for full document fidelity. The users text including spacing and
comments are preserved.</li>
<li>Undo / Redo is supported using the concept of an immutable tree. XDM nodes
do not have parent pointers (only a pointer to the model). Thus a node can
be in multiple trees, where each tree is a version. When a mutation to the tree
occurs a clone is made of each node in the parent path from the root to the mutated
node. All unchanged nodes are simply referenced and thus will live in multiple
trees. Thus an undo / redo is simply a reference change. The cost of storing
multiple tree is minimized as only the diffs are stored in each version of the
tree.</li>
<li>The visitor pattern is used in addition to the DOM interfaces which allows
easier tree walking</li>
<li>An XML diff visitor supports XML difference. Element identity can be
supplied by the client.</li>
</ul>
</answer>
<!-- <questionid="compat-standards"when="init"> Doesthemoduleimplementordefineanystandards?Isthe implementationexactordoesitdeviatesomehow? </question>
-->
<answer id="compat-standards">
<p>
This module implements the DOM interfaces but is not intended to be a
replacement for DOM. This module has special semantics surrounding mutation
and thus the full DOM interfaces are not supported.
</p>
</answer>
<!-- <questionid="compat-version"when="impl"> Canyourmodulecoexistwithearlierandfuture versionsofitself?Canyoucorrectlyreadalloldsettings?Willfuture versionsbeabletoreadyourcurrentsettings?Canyouread orpolitelyignoresettingsstoredbyafutureversion? <hint> Veryhelpfulforreadingsettingsistostoreversionnumber there,sofutureversionscandecidewhetherhowtoread/convert thesettingsandolderversionscanignorethenewones. </hint> </question>
-->
<answer id="compat-version">
<p>
no settings or user visible features.
</p>
</answer>
<!-- <questionid="exec-introspection"when="impl"> Doesyourmoduleuseanykindofruntimetypeinformation(<code>instanceof</code>, workwith<code>java.lang.Class</code>,etc.)? <hint> CheckforcaseswhenyouhaveanobjectoftypeAandyoualso expectitto(possibly)beoftypeBanddosomespecialaction.That shouldbedocumented.Thesameappliesonoperationsinmeta-level (Class.isInstance(...),Class.isAssignableFrom(...),etc.). </hint> </question>
-->
<answer id="exec-introspection">
<p>
The casting is documented. This needs to be reviewed and cleaned up. We need
to look at each instanceof, AssignableFrom, and cast to see if we can eliminate
this using a) visitor b) JDK 1.5 return value override
</p>
</answer>
<!-- <questionid="exec-threading"when="impl"> Whatthreadingmodels,ifany,doesyourmoduleadhereto? <hint> IfyourmodulecallsforeignAPIswhichhaveaspecificthreadingmodel, indicatehowyoucomplywiththerequirementsformultithreadedaccess (synchronization,mutexes,etc.)applicabletothoseAPIs. IfyourmoduledefinesanyAPIs,orhascomplexinternalstructures thatmightbeusedfrommultiplethreads,declarehowyouprotect dataagainstconcurrentaccess,raceconditions,deadlocks,etc., andwhethersuchrulesareenforcedbyruntimewarnings,errors,assertions,etc. Examples:aclassmightbenon-thread-safe(likeJavaCollections);might befullythread-safe(internallocking);mightrequireaccessthroughamutex (andmayormaynotautomaticallyacquirethatmutexonbehalfofaclientmethod); mightbeabletorunonlyintheeventqueue;etc. Alsodescribewhenanyeventsarefired:synchronously,asynchronously,etc. Ideas:<ahref="http://core.netbeans.org/proposals/threading/index.html#recommendations">ThreadingRecommendations</a>(inprogress) </hint> </question>
-->
<answer id="exec-threading">
<p>
This model has been synchronized for thread safety. Thread safety is supported
by allowing only a single model mutation (using java synchronized keyword). The
immutable nature of the model only requires synchronization when updating the
tree thus synchronization of nodes which are not yet in the tree is not thread
safe.
</p>
</answer>
<!-- <questionid="format-types"when="impl"> Whichprotocolsandfileformats(ifany)doesyourmodulereadorwriteondisk, ortransmitorreceiveoverthenetwork?Doyougenerateanantbuildscript? Canitbeeditedandmodified? <hint> <p> Filescanbereadandwrittenbyotherprograms,modulesandusers.Iftheyinfluence yourbehaviour,makesureyoueitherdocumenttheformatorclaimthatitisaprivate api(usingthe<api>tag). </p> <p> Ifyougenerateanantbuildfile,thisisverylikelygoingtobeseenbyendusersand theywillbeattemptedtoeditit.Youshouldbereadyforthatandprovideherealink todocumentationthatyouhaveforsuchpurposesandalsodescribehowyouaregoingto understandsuchfilesduringnextrelease,whenyou(verylikely)slightlychangethe format. </p> </hint> </question>
-->
<answer id="format-types">
<p>
This module is designed to read and write XML files through a swing document.
</p>
</answer>
<!-- <questionid="perf-limit"when="init"> Arethereanyhard-codedorpracticallimitsinthenumberorsizeof elementsyourcodecanhandle? </question>
-->
<answer id="perf-limit">
<p>
no. This module is able to parse large schemas > 1MB.
</p>
</answer>
<!-- <questionid="perf-mem"when="final"> Howmuchmemorydoesyourcomponentconsume?Estimate witharelationtothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
<p>
A basic populated model is about 8000 bytes, this depends on how many components
and the size of the file.
</p>
</answer>
<!-- <questionid="perf-progress"when="final"> Doesyourmoduleexecuteanylong-runningtasks? <hint>Longrunningtasksshouldneverblock AWTthreadasitbadlyhurtstheUI <ahref="http://performance.netbeans.org/responsiveness/issues.html"> responsiveness</a>. Taskslikeconnectingover network,computinghugeamountofdata,compilation bedoneasynchronously(forexample using<code>RequestProcessor</code>),definitivelyitshould notblockAWTthread. </hint> </question>
-->
<answer id="perf-progress">
<p>
This module is used by clients and thus does not react directly to user
events.
</p>
</answer>
<!-- <questionid="perf-scale"when="init"> Whichexternalcriteriainfluencetheperformanceofyour program(sizeoffileineditor,numberoffilesinmenu, insourcedirectory,etc.)andhowwellyourcodescales? <hint> Pleaseincludesomeestimates,thereareothermoredetailed questionstoanswerinlaterphasesofimplementation. </hint> </question>
-->
<answer id="perf-scale">
<p>
The size of the XML file both in terms of the number of bytes as well as
the number of elements and attributes.
</p>
</answer>
<!-- <questionid="perf-spi"when="init"> Howtheperformanceofthepluggedincodewillbeenforced? <hint> Ifyouallowforeigncodetobepluggedintoyourownmodule,how doyouenforcethatitwillbehavecorrectlyandquicklyandwillnot negativelyinfluencetheperformanceofyourownmodule? </hint> </question>
-->
<answer id="perf-spi">
<p>
Client code providing element identity may impact the performance of sync.
However, invoking sync is done by the client as thus the impact will be
reflected in the client module. There is no direct user interaction in
this module.
</p>
</answer>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.