Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-6417

YANG Tools: Generated code interfaces to be self sufficient and needn't rely on base objects

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.10.0
    • Component/s: YangCompiler
    • Labels:
      None

      Description

      > 1. Currently every POJO has an interface, but I am not sure if
      > interfaces are necessary for applications to use. The main issue I
      > have with interfaces is that the "augmentation()" API does not exist
      > on interfaces. Rather, it exists only on implementation classes, which
      > inherit it from InnerModelObject. For example, consider the following
      > function:
      >
      > private DeviceInfo buildDevVpnIns(Bearer bearer, VpnInstance ins,
      > VpnSiteRole role, IpConnection connect)

      { > DefaultAugmentedL3VpnBearer augBearer = ((DefaultBearer) bearer) > .augmentation(DefaultAugmentedL3VpnBearer.class); > }

      >
      > Bearer is an interface and does not have the augmentation() method. So
      > only after we cast it to DefaultBearer, can we see that API. So, why
      > can we not just pass in DefaultBearer directly?
      >
      > Another minor issue with using interfaces is that, if the application
      > use interfaces, then it has to import both interfaces and
      > implementations, which doubles the size of the import list. Depending
      > on the complexity of the YANG model which an application uses, it may
      > need to import lots of generated class, so the import list could
      > become very long.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            Vidyashree-Huawei Vidyashree Rama
            Reporter:
            gauravagrawal Gaurav Agrawal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: