Comments (8)
I don't think we should focus on it now, as it seems like a feature and not a complete rewrite that is required to fully make this work. But good points to remember for the future 👍
from modelina.
I don't think we should focus on it now, as it seems like a feature and not a complete rewrite that is required to fully make this work. But good points to remember for the future 👍
Maybe you want to pop out this from Version 1 milestone?
from modelina.
Still relevant.
from modelina.
Still relevant.
from modelina.
Currently, supported inputs don't really support inheritance (we could discuss if JSON Schema somehow does, but it doesn't really do).
However, if we ever support any other language as input (like PHP for example), the generators will need explicit info about both a class extending and/or implementing an interface. See the following examples:
Class Iinheritance:
class Human extends Animal
Implementing an interface:
class Human implements LivingBeing
But also
class Human extends Animal implements LivingBeing
And also the fact a class can implement several interfaces.
So, does this issue still applies? Do we want to support at model level? is it worth to support right now?
from modelina.
@jonaslagoni @smoya I think that my idea should "fix" that problem #628
from modelina.
I have been thinking a bit about this feature, and there is one huge problem with it, that I dont know if we want to introduce - and that is complexity.
When you write presets and use the class to anything, you MUST remember that it CAN extend from something else, and handle that accordingly. Which is a HUGE effort which needs to be put into Modelina, without much benefit IMO.
I can however see a reason we would want to introduce a preset hook (for now) that enables you to more easily extend from your own custom class, in case you have some use-case where that would suit you. But it does not force preset and generator creators to handle any of the complexity because it's not something thats added to the ConstrainedModel
.
The complexity I am referring to is for example in serialize presets that given the following generated models in C#:
public class Person
{
public string FName { get; set; }
public string LName { get; set; }
public Person(string fname, string lname)
{
FName = fname;
LName = lname;
}
}
public class Student : Person
{
public Student(Person person, string code)
: base(person.FName, person.LName)
{
this.code = code;
}
public Student(Person person)
: base(person.FName, person.LName)
{
}
public string code { get; set; }
}
Suddenly need to look into the superclass Person
when serializing Student
, it is very easy to forget this and takes quite a few lines of code to get right.
I dont know, I think we will have to see as the library grows whether this is really needed to be supported in full.
from modelina.
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience ❤️
from modelina.
Related Issues (20)
- Remove duplicates in this character class. HOT 2
- The object passed as the value prop to the Context provider changes every render. To fix this consider wrapping it in a useMemo hook. HOT 3
- Remove this property or method or refactor "DartGeneratorOptions", as "context" is not used inside component body HOT 2
- Unnecessary use of boolean literals in conditional expression. HOT 3
- The object passed as the value prop to the Context provider changes every render. To fix this consider wrapping it in a useMemo hook. HOT 3
- '../../../../../' import is duplicated. HOT 2
- '../../../../../' import is duplicated. HOT 2
- Prefer using an optional chain expression instead, as it's more concise and easier to read. HOT 2
- "switch" statements should have at least 3 "case" clauses HOT 2
- '../../helpers' import is duplicated. HOT 3
- Remove this unused import of 'KOTLIN_DEFAULT_PRESET'. HOT 2
- Remove this unused import of 'JAVA_COMMON_PRESET'. HOT 4
- Remove this unused import of 'CommonModel'. HOT 2
- AsyncAPI message.messageId() is not used for root payload HOT 1
- TypeScript include documentation for properties instead of getters HOT 7
- Remove unnecessary `isAsyncAPIOwner` field from .asyncapi-tool HOT 2
- asyncapi CLI model generation fails if AnyModel is used HOT 4
- Messages elements are not generated HOT 5
- AnonymousSchema file is generated for Enum HOT 8
- JavaGenerator and JavaFileGenerator has too different arguments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modelina.