Skip to content

Reflection_Engine: Subtypes query added #2965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 9, 2023

Conversation

pawelbaran
Copy link
Member

@pawelbaran pawelbaran commented Dec 20, 2022

Issues addressed by this PR

Closes #2964

Test files

On SharePoint

Changelog

ImplementingTypes and Subtypes are essentially the same method, but I did not dare to merge them taken slightly different use cases (at least in my mind). However, happy to do it if requested in the review.

Additional comments

Copy link
Contributor

@FraserGreenroyd FraserGreenroyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the primary differences between the methods is that one is specifically for interfaces and the other (the new one, SubTypes) is not.

Originally, I would say I wouldn't see the point of the second given the BHoM inheritance structure prohibits object inheritance, however we have broken that rule in strategic places, so I can see a reason for wanting to know the subtypes of non-interface types.

But I'm not sure we need two methods to achieve this. I think a bool flag on ImplementingTypes for interfaceOnly would suffice? While I like the attempt to keep it tidy by having one call the other, I'm just not convinced the use case for individual methods is that strong as opposed to a modification of the existing one?

Though maybe the default bool could cause confusion so I can also see an argument for having them as separate methods... Happy to see what others think for a final decision I think.

@pawelbaran
Copy link
Member Author

Hmm, I got confused now @FraserGreenroyd. The facts as I see them:

  • both methods return only non-abstract, non-interface BHoM types
  • ImplementingTypes method accepts only interface types, while Subtypes will be happy with any input of type Type
  • technically ImplementingTypes is the same method as Subtypes, just more strict on the input properties

...bool input parameter seems a bit redundant to me in this case, I was more considering whether we need ImplementingTypes altogether. Or am I missing something?

@pawelbaran pawelbaran changed the base branch from main to develop January 3, 2023 09:37
Copy link
Contributor

@FraserGreenroyd FraserGreenroyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with the discussion from above - could we generate a unit test for this before merge though @pawelbaran ?

@pawelbaran pawelbaran force-pushed the Reflection_Engine-#2964-SubtypesQuery branch from 4473e5e to 219e637 Compare January 6, 2023 17:29
@pawelbaran
Copy link
Member Author

I will generate UTs on Monday @FraserGreenroyd - thanks!

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check unit-tests

@bhombot-ci
Copy link

bhombot-ci bot commented Jan 9, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check unit-tests

@FraserGreenroyd
Copy link
Contributor

Following review of the unit test @pawelbaran built, it has been determined that this won't work with the overall unit test strategy as originally thought so I have removed the unit test for now to be revisited in the future.

@BHoMBot check compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Jan 9, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check versioning
@BHoMBot check required

@bhombot-ci
Copy link

bhombot-ci bot commented Jan 9, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning
  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

There are 7 requests in the queue ahead of you.

@bhombot-ci
Copy link

bhombot-ci bot commented Jan 9, 2023

The check code-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@bhombot-ci
Copy link

bhombot-ci bot commented Jan 9, 2023

The check documentation-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check unit-tests
@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Jan 9, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check unit-tests
  • check ready-to-merge

Copy link
Contributor

@FraserGreenroyd FraserGreenroyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code works and looks good, happy to deploy to support the Mongo work as this can be merged independently.

@FraserGreenroyd
Copy link
Contributor

@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Jan 9, 2023

@FraserGreenroyd to confirm, the following actions are now queued:

  • check ready-to-merge

@FraserGreenroyd
Copy link
Contributor

@BHoMBot this is a DevOps instruction. I am requesting neutral checks on: ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Jan 9, 2023

@FraserGreenroyd I have provided neutral checks to the checks requested. These checks will need to be run properly to obtain full results.

@FraserGreenroyd FraserGreenroyd merged commit 748f7a9 into develop Jan 9, 2023
@FraserGreenroyd FraserGreenroyd deleted the Reflection_Engine-#2964-SubtypesQuery branch January 9, 2023 13:58
@bhombot-ci bhombot-ci bot mentioned this pull request Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reflection_Engine: Add a method to query subtypes of a type
2 participants