<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p><a class="moz-txt-link-freetext" href="https://howtodoinjava.com/design-patterns/creational/builder-pattern-in-java/">https://howtodoinjava.com/design-patterns/creational/builder-pattern-in-java/</a></p>
<p>Builder in Dart:<br>
</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/dart-lang/code_builder">https://github.com/dart-lang/code_builder</a></p>
<p><br>
</p>
<p>I call the Builder pattern the Importer/Exporter pattern. One
passes the Importer or subclass to the node or statement
constructor, and the Exporter, Formatter or subclass is passed to
the node or statement outputter. I think it would be a good plan
to pass a Builder or Importer to a constructor in Java.<br>
</p>
<p>Main advantages: 1) Immutability 2) Encapsulation<br>
</p>
<p>Main disadvantages: 1) code bloat.</p>
<p>According to the first link, you create a Builder as an enclosed
class of the class you want to build. You can have a class
hierarchy of Importer/Exporters you want for different encodings,
etc.</p>
<p>Obviously, I offer this as an alternative to XSLT hell. However,
we may need to bootstrap with XSLT, I think, and it would be good
to have roundtrip with the XSLT. My preference is to bootstrap
into Java. Then add different Exporters as alternatives to the
XSLT Exporter. For exporting, you pass the exporter to the
outputter method, and then extract any data values using getters
on the exporter.<br>
</p>
<p>Obviously this is a step away from the "Java Beans," "Enterprise
Java Beans," "Plain Old Java Object" and "Data Transfer Object"
patterns of Java. The important thing is immutability and
encapsulation for proper object-oriented design.</p>
<p>I think this would be a good pattern for Blender I/O plugins to
follow. Would it be possible to generate the Blender X3D plugins
from X3DJSAIL?<br>
</p>
<p>What I will attempt to do is create a new Serializer in
JavaScript to produce Java "Importer/Exporter" examples, but I may
need to dig into X3DJSAIL. Perhaps I can treat current X3DJSAIL
classes as importer/exporters. I think this way, we can advance
step-by-step to the next generation of X3DJSAIL.</p>
<p>Question: Does C/C++/C# SAI or other SAI already follow this?
Is this "CreateX3dFromString()"?<br>
</p>
<p>John<br>
</p>
<p>Additionally, I will work with es6x3d and x3d.dart to adopt
importer/exporter patterns.</p>
<p>I do not see this as a problem per se for Python or Dart. But it
would be good to have exporters for Python and Dart in X3DJSAIL.
It may help with the pyjnius X3DJSAIL-Python SAI.</p>
<p>I am thinking of leaving the org.x3d.web3d.jsail as
Importers/Exporters and starting a new package next to sai and
jsail in X3DJSAIL. Perhaps there would be some organization of
Importers/Exporters by input/output language under jsail.<br>
</p>
<p>John<img src="cid:part1.9DF7738D.2F9EAF9A@gmail.com" alt=""></p>
</body>
</html>