Advance Usage of DMT Framework


This example show you how to use DMT Framework bring your Domain Model Back in the way you want.

First you need to setup your project to use DMT Framework

Suppose you have a class called UserAccount, It has Reference to Address and Company. And, it has following attributes:
You want bring back the UserAccount with attributes only need for the client side, let's say(userName, accountNumber, moneyReserve, company), for other attributes you don't want them because it is redaundent data to your current user interface display. And, you have All the companys maintained in your client side cache, you don't want transport them again every time when you call getUserAccount Command.

To achieve this, you need:
<dmtschema name="getUserAccount" version="0">
    <default_dmtspec>
        <exclude name="createDateTime"/>
        <exclude name="lastModifiedDateTime"/>
        <exclude name="createdBy"/>
        <exclude name="modifiedBy"/>
    </default_dmtspec>
   
    <externalizer type_name="Company">CompanyExternalizer</externalizer>
   
    <dmtspec classname="UserAccount">
        <include>userName</include>
        <include>accountNumber</include>
        <include>moneyReserve</include>
        <include>company</include>
    </dmtspec>
</dmtschema>

To define this schema in hand might becomes a tedious job, we have developed an eclipse plugin, you can generate this schema very easily