Hello Jose,
On 9/27/05, Jose Ramon Palanco <jos...@ha...> wrote:
> Hi!
>
> a few weeks ago, I was patching 'Glade# code generator' to generate
> nemerle source code. It was pretty easy due it, because it uses codedom.
>
> Codedom allow us generate code for .NET languages (maybe others?) just
> adding a few lines.
>
> I don't the reason why this feature is not available for EC; actually
> I'am an inept in this area, but I think it could be productive use this
> capability for c#, boo, nemerle and VB.NET, the reason is 'cause we dont
> need to mantain it. We only have to mantain SQL, C, or others..
There's nothing in EC that impedes the use of CodeDom. It's perfectly
feasible to write a code generator with EC.Uml2 for the input model,
EC.ExpertSystems for the rules, and CodeDom for the output model. You
could even take out the rules, and write the logic with regular object
oriented programming. It is also possible to avoid using EC.Uml2, and
still write a code generator without using EC at all ;-)
Maybe you're talking about the "UML to C#" code generator that is part
of EC and is used by MonoUML. In that case, yes, it would have been a
good idea to use CodeDom, because we're making a very fine grained
translation. In other cases, it's good to have templates, so we can
map a broad concept (e.g a Class) to a big block of code.
> It is only an idea, I'm sure Rodolfo has his own reasons for don't use
> it. I will be pleased to read it.
If we're talking about the "UML to C#" code generator, I don't have
any reason for not using CodeDom, except maybe that it works as it is.
But now that you mentioned it, I'm thinking that using templates was a
bad idea in the first place, and we're given a bad example to follow,
because in this particular code generator the right choice seems to be
CodeDom. Using CodeDom brings another advantage: it would demonstrate
that EC can get along with external libraries, and that the experts
system engine is really model agnostic.
Maybe it's time to do a full rewrite of this code generator with these
ideas in mind, and host it within MonoUML, were it belongs. What do
you think about that?
> Best regards!
Thanks for your interest in EC.
Cheers,
Rodolfo
|