Currently, I am utilizing the Joose Javascript ORM plugin, which is still quite young (project page). This is being used to store objects in an Appcelerator Titanium mobile project (company page). Due to the storage being on the client side, the application needs to verify if the database is initialized before launching the ORM, as it examines the DB tables for class construction.
The issue I am facing is that this series of operations requires numerous callbacks to complete. It results in a convoluted code structure with excessive jumps, making it challenging for future maintenance and leading to complex call graphs. Hence, I have the following queries:
- How can one asynchronously initialize a database and load it with seed data when using an ORM that relies on accurate schema for functioning?
- Can you share any effective strategies or resources for asynchronous/event-driven programming while maintaining a simple and comprehensible call graph?
- Do you have recommendations for Javascript ORMs/meta object systems compatible with HTML 5 as a storage engine and ideally framework-independent?
- Is it possible that I am underestimating the complexity here and should be able to resolve it easily?
Your insights are greatly appreciated! Thank you!