Repository navigation
Simplify Elide Core by decoupling from JSON-API #3426
chirdeeptomar
started this conversation in
Ideas
Replies: 0 comments
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.
I would like to suggest the separation of the JSON-API from the Core to simplify and decouple the Core Elide from the communication protocol.
CoPilot has suggest the demarcation clearly and it's documented as below:
Elide Architecture Refactoring: Protocol-Agnostic Core
Overview
This document describes the architectural changes needed to separate protocol-specific concerns (JSON-API, GraphQL, etc.) from the core Elide data access framework.
Current Problem
Elide's
RequestScopeandPersistentResourceclasses are tightly coupled to JSON-API concerns:RequestScope (elide-core)
sparseFields,expressionsByType,globalFilterExpressionparseSparseFields(),getFilterExpressionByType(),getLoadFilterExpression(),getExpressionForRelation()PersistentResource (elide-core)
toResource(),getRelationships(),getAttributes()updateAttribute(),updateRelation(),deleteResource()Result
Solution Architecture
New Class Hierarchy
Core Responsibilities (Protocol-Agnostic)
RequestScope handles:
PersistentResource handles:
Protocol-Specific Responsibilities
JsonApiRequestScope adds:
fields[User]=name,email)JsonApiPersistentResource adds:
ResourceobjectsGraphQLRequestScope (future) adds:
File Structure (New)
Benefits
Migration Path
Metrics
Success Criteria
✅ All JSON-API tests pass with new
JsonApiRequestScope✅ All GraphQL tests pass without modification
✅ No changes to public API contracts
✅ New protocols (e.g., REST) can be added without modifying core
✅ Code coverage remains >80%
Happy to work on it and raise a PR.
All reactions