Skip to content

Conversation

@badcel
Copy link
Contributor

@badcel badcel commented Jan 11, 2026

WIP and discussion

  • This is a sample on how the current conversion to a GirCore would look like if there is no paramterless constructor anymore.
  • Please ignore the compiler errors: This is build for Manually set instance cache during object creation gircore/gir.core#1437
  • Readonly member / properties support is lost
  • Initialize method can be used for non parametrized initialization. This would even work if the instance is created in C and not known to dotnet
  • The New factory method is used to configure the instance in a certain way

Insights:

  • All subclasses must be touched, there is no soft migration
  • Certain dotnet compiler optimizations might be lost

Questions:

  • Do we need support to install properties / construct properties inside GObject to (eventually) support read only properties? Should this be delivered later or is it a prerequisite? Partial properties are supported with dotnet 9 and could be handy for this case. As GirCore supports dotnet 8 this is available with dotnet 9. If this works NewWithProperties could be used to set those properties.
  • Do we need a soft migration? This would lead to more in complete / seemingly buggy composite template support because eventually templates would not be initialized correctly if the instances are not known to C# (in case of hierarchical composite templates).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant