Menu

Compiling in VS.Net 2003

Help
2006-10-21
2013-04-29
  • Paul Ruiz Pauker

    I'm trying to compile NUML in Visual Studio .Net 2003.

    When compiling CMOF project, I get the error:
    "...\NUML2\src\Mof2\Cmof\Package.cs(37): 'Package': member names cannot be the same as their enclosing type"

    public interface Package: ...
    {
      ...
      Package Package { get; set; }
      ...
    }

    This is because in C# (VS.Net) is not allowed to name an method (or property) with the class name, I don't know how it goes in Mono.

    I was thinking in just rename the "Package" property to ThePackage, do you think it'll really work? Another solution?

    Paul.

     
    • Paul Ruiz Pauker

      I've rename it to OwnerPackage, and it worked right.

       
      • Paul Ruiz Pauker

        I don't get any idea of how do I serialize a model to XMI.

        Help please.

         
        • Rodolfo Campero

          Rodolfo Campero - 2006-10-21

          Hi,

          Take a look at the tutorial:
          (the URL is one single line)

          http://numl.sourceforge.net/index.php/Manipulating_Models#XMI_Serialization

          If you still have doubts, feel free to post them here - please start a new thread for each question.

          Best regards,
          Rodolfo

           
      • Rodolfo Campero

        Rodolfo Campero - 2006-10-21

        Hello Paul,

        That's weird... I'll check this error on Monday.

        In the meantime, my advice would be to use the name _Package, because I've seen this convention in other libraries and mappings (I mean, the use of an underscore as a prefix). If I can reproduce the problem, this will be the new name.

        Thanks for your interest in nUML and your feedback.

        Regards,
        Rodolfo

         
    • Paul Ruiz Pauker

      Thanks Rodolfo,

      I've already change it to OwnerPackage, and it worked fine.

      Does the name need to be _Package? if you wish I can change it and send you a copy.

      Paul.

       
      • Rodolfo Campero

        Rodolfo Campero - 2006-10-23

        Hello Paul,

        I've checked the spec (ptc/03-09-15 UML 2.0 Infrastructure Final Adopted Specification) and the "package" attribute was removed, leaving "nestingPackage" in its place.

        As we already have a "NestingPackage" property, the correct thing to do would be to remove the "Package" property from both, the interface file Package.cs and the implementation class file "__ImplPackage.cs". This applies to the CMOF and UML libraries.

        So you should use NestingPackage instead of OwnerPackage in your project.

        I'll apply and commit these changes this afternoon.

        Thanks again for your feedback, it is highly appreciated.

        Best regards,
        Rodolfo

         
        • Paul Ruiz Pauker

          Hi Rodolfo,

          The latest UML Infrastructure specification is ptc/04-10-14,
          and for Superstructure it's formal/05-07-04

          Guess yours is out of date.

          Regards,

          Paul

           
          • Rodolfo Campero

            Rodolfo Campero - 2006-10-23

            Hi,

            You're right - partially at least ;)

            The latest specs for version 2.0 are formal/05-07-04 for Superstructure, and formal/05-07-05 for Infrastructure.

            Looking at these specs I saw that Package::package was removed from Infrastructure but kept in Superstructure. So I'll remove Package.Package from CMOF and rename it to _Package in UML.

            Nevertheless, I still recommend you to use NestingPackage instead, because Package::package was removed in UML 2.1.

            Besides that, have you figured out how to use XMI serialization? if you have any doubts, don't hesitate to ask.

            Regards,
            Rodolfo

             

Log in to post a comment.

MongoDB Logo MongoDB