Model, AbstractModel and buffers. #64
Locked
alexandercerutti
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
|
@ianbale @neogucky @Dicondur @moogus May I have feedback from you please? Thank you very much! |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was reasoning on the core concepts that compose passkit-generator and comparing them against other libraries.
One of the core concepts regards the creation of model.
In the current situation, passkit-generator allows creating a pass starting from:
I always thought that passkit-generator should have not allowed users to create runtime models. And maybe this could be one of the reasons for which other libraries might get chosen.
When I created v2.0, I thought that PG might have run in two different contexts that have Node.JS APIs:
Now, when talking about the first case, the library is kept loaded and the application can load the model in any way the developer wants.
But when talking about the second case, the library must be reloaded if we have cold-starts. So the possible ways to create the model here are:
Having a bucket or any similar concept may cost, so maybe the first approach might be preferred when developing a cloud function.
I must add that I actually don't know how many of you are using AbstractModel to keep data in memory and if you consider it useful for your implementations.
So I was thinking about a refactor, to be implemented in v3, concerning model concepts we have in the current situation.
My idea was to "merge" all of them in... maybe one class?
These are the core points a model should do:
So we could have a class that could be used like this / have this signature for example:
Having such a class that allows a Model to be built through a buffer list, would allow the developer to create a template in runtime I guess. We could also allow
pass.jsonto be passed as a buffer, string, or JSON object.Would also be useful for the Model instance to be "closed" or "destroyed" to avoid it being used again?
Let me know.
Thank you for the feedback.
Beta Was this translation helpful? Give feedback.
All reactions