what about the application assembler/deployer roles?
1 posts in topic
Flat View  Flat View

Posted By:   Robert_Patton
Posted On:   Friday, May 10, 2002 05:39 PM

Putting assembly information like the transactional behavior into the source code itself seems risky. How are people using XDoclet in production environments that do break out roles similar to the ones Sun suggests? Are you really going back and editing the source code if ejb-refs, transactions or datasource names change?

Re: what about the application assembler/deployer roles?

Posted By:   Ara_Abrahamian  
Posted On:   Saturday, May 11, 2002 11:42 PM

Good question!

Well, when working with XDoclet we can divide the task to development-oriented and deployment-oriented tasks (more or less like what EJB spec suggests). So if you embedd transaction/roles/table-name/column-name/etc in your code as xdoclet @tags you're doing it to speed up your development cycle and test it easily. Now when you actually want to deploy it (the deployer role, or maybe other roles too) you can simply override the base settings the original developer provided. So for example if you're using websphere then use AAT tool and change roles/mapping/table-names according to that specific deployment characteristics.

But XDoclet also provides some mechanisms to make it even easier (not late time deployment changes, but earlier in coding phase but not tightly embedded deep inside the code). These machanisms are:

  • Merge files: So instead of putting security role settings in the code using the specific @tags, use a merge file (security-roles-{classname}.xml for example, refer to docs for exact details).

  • Use Ant properties: So instead of hard coding @ejb:persistence table-name="t_customer", do it like this @ejb:persistence table-name="${customer_table_name}" and specify customer_table_name in ant (preferabbly with a properties file containing the Ant properties and their value).

By apllying the above tricks you can easily separate development and deployment settings and we highly recommend you to do that!


About | Sitemap | Contact