Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need an idea to write a custom classloader

 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to write a custom classloader which can take the MOF(Meta-Object-facility) model as input and generate actual java classes from it and load it to ILog JRules Builder as BOM (Business-Object-Model)

Can somebody with good experience on this help me out please.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's one -

Can you represent the MOF in a *clean* XML format? If yes, you could write a XSL style sheet to churn out Java classes. We do that for our MDA based activities - model-->xml-->xslt-->generated java files.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahkil --

Please Carefully Choose One Forum when posting to JavaRanch. I've deleted a number of other copies of this thread, saving only this one as it's already gotten a reply.
 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really Appologise for the mistake Earnest...but i was not getting the actuall forum where to post it and so i posted it where ever i thought it could be relevant.
I am sorry for it.

Hey Ajith can you mail me that example of yours.
and did you guys generated the XML file too from the model?
since it will also require an overhead of creating the XSD first and then genrating XML.any how if you can send me your example..it will be of great help
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I can't send you any code samples because of non disclosure agreements. But here's the flow.

1. We create models in a modeling environment(XDE, Rose etc.)
2. We then execute plug-ins from the modeling environment to generate design artifacts - typically XML files.
3. Class loaders consume these XML files, apply proprietary XSL and generate java classes. Generation can also be done at build time.

As you can see, the MDA plug-ins do an interesting job of converting over the models( or parts of models ) to XML files that subscribe to some internally published schema. The plug-in is an extra convenience, but if you know and understand the MOF structure, I'm sure you can do the same in a stand alone tool.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic