Uploaded image for project: 'The AndroMDA project'
  1. The AndroMDA project
  2. ANDROMDA-481

Entities and DAOs should contain factory method for creating empty Entities / POJOs

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      1)
      On entities, add a method "public static create<NameOfTheEntity>()". For the entity Person, this looks like:

      public static Person createPerson() {
      return new PersonImpl();
      }

      2)
      On DAOs, add the same method.

      3) To give users the flexibility they demand for, it should configurable whether the factory method should be added to the Entity or to the DAO. Maybe it is a good idea to do it exactly the way it is done for business operations. Talen from the doc: "Entity business operations can be set to classifier scope instead of the usual instance scope. By doing so they will be generated into the corresponding DAO for that entity instead of the entity implementation class."

      I am not quite sure what would be the most natural way to model this.
      a) Maybe it is ok to have the factory method generated in any case (this means we do not mean any way to express the existance or absence of the factory method in the model)
      b) Another way would be to introduce a new stereotype <<FactoryMethod>>, but then we'd need a stereotype for <<BusinessMethod>> as well, in order to make things consistent
      c) Maybe there is a way to model this I am not aware of

        Attachments

          Activity

            People

            • Assignee:
              overheat overheat
              Reporter:
              freter Peter Friese
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: