Skip to content

When a JSII interface has a name like IFoo, the generated .NET interface is named IIFoo #109

Closed

Description

@mpiroc

We should detect the case where the interface already has the I- prefix, and skip adding an additional I- prefix in this case.

Open question: What if the interface is named something like IAMFoo? I.e. it begins with I<capital letter>, but the I isn't intended as a prefix.

Activity

  1. added
    language/dotnet
    on Aug 11, 2018
  2. added
    feature-request
    and removed on Jan 3, 2019
  3. added
    effort/large
    on Apr 22, 2019
  4. added this to the milestone on Jul 30, 2019
  5. assyadh commented on Aug 12, 2019

    @assyadh
    Contributor

    After talking with Romain, we chose to:

    Not prefix with I anymore for interfaces that are NOT datatype (jsii already enforces that non-datatype interfaces have a name prefixed with the I). Only datatype interfaces should append an I.

  6. eladb commented on Aug 12, 2019

    @eladb
    Contributor

    Do we really need interfaces for data types? I was under the impression that in .NET we can express these data types without interfaces.

  7. assyadh commented on Aug 12, 2019

    @assyadh
    Contributor

    See my comment here:

    https://github.com/aws/jsii/blob/master/packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts#L148

    Right now for each interface we create the interface, the interface proxy and the interface datatype class (implementing the original interface).

    In the case of a datatype (props), we could do with JUST the datatype, not implementing any interface.

    Relates: #480

    Given that props objects are datatypes, they would live by themselves.

  8. eladb commented on Aug 13, 2019

    @eladb
    Contributor

    So if I understand correctly the answer is that we can get rid of interfaces for data types (formally known as “structs”). Correct?

  9. assyadh commented on Aug 13, 2019

    @assyadh
    Contributor

    Yes

  10. fulghum commented on Aug 13, 2019

    @fulghum

    @assyadh – so the work for this task now, is just to remove the generation of interfaces for struct/data classes?

  11. added
    effort/small
    and removed
    effort/large
    on Aug 13, 2019
  12. added
    needs-discussion
    on Aug 13, 2019
  13. assyadh commented on Aug 13, 2019

    @assyadh
    Contributor

    After discussion with Romain at the bindings meeting, looks like the interfaces are here to stay. There is usecases of interfaces implementations that are allowed by the language. Removing them would be a deal breaker.

    I'll let @RomainMuller chime in on the specifics.

  14. RomainMuller commented on Aug 13, 2019

    @RomainMuller
    Contributor

    The current state of things is that data types support multiple inheritance, which implies supporting interfaces in dotnet. Have to check whether we can disallow multiple inheritance, which would render interfaces unnecessary.

  15. assyadh commented on Aug 20, 2019

    @assyadh
    Contributor

    After discussion with @RomainMuller , we can remove the added I in the interfaces as it JSII is already enforcing the I for an interface.

  16. added a commit that references this issue on Aug 22, 2019
    b9621f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort/smallfeature-requestlanguage/dotnetneeds-discussionp0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions