Difference between Html *** Builder and Dom *** Builder classes in Gwt

I am trying to manipulate the DOM from my Gwt code. In the process, I discovered two groups of classes that implement a common base interface, eg.

interface DivBuilder  

class HtmlDivBuilder implements DivBuilder

class DOMDivBuilder implements DivBuilder 

      

for each Html tag there are two such sets of classes implemented

I am confused as to what is the purpose and use behind this.

Any pointers should be helpful.

+3


source to share


1 answer


The family Html

creates a string that can later be used with innerHtml

. It can also be used on the server side.

The family Dom

creates a DOM subtree.



The goal is that you can use code that uses builders and can be called with either a specific implementation depending on the use case. For example, a cell table can use any strategy and builders can remain the same.

+2


source







All Articles