cyremurC
Convex Community3y ago
7 replies
cyremur

I have to admit I have a guilty pleasure

I have to admit I have a guilty pleasure of OOP. Ideally, I want to have Class Instances in my state that have prototype functions to mutate themselves and/or other objects in state. I know namespaces and passing in the object as a first argument kind of does the same, but it just doesn't look as nice to me. By the looks of it, I should serialize class instances into POJOs for saving with convex, right? So does it make sense to have the following workflow in my mutations?
1. load POJO from convex db
2. deserialize into class instances with functions again
3. do OOP state manipulation magic
4. serialize class instances into POJOs
5. upsert POJOs to convex db
Was this page helpful?