Problem Statement
Compare using `Codable` to persist simple models vs using `CoreData` for complex object graphs in Swift. Provide reasoning and trade-offs.
Explanation
For simple data persistence—small models, straightforward relationships or caching—you might choose `Codable` with JSON, plist or local files because it is lightweight, easy to implement and requires minimal overhead. /n/n However for complex object graphs, relationships, undo support, querying/filtering, change tracking and large data sets you should use `Core Data`. Core Data provides object graph management, persistent stores, lazy faulting and powerful querying, but it comes with heavier setup, learning curve and more maintenance. In interviews, outlining the trade-offs (ease vs power, speed vs flexibility, relational vs flat storage) shows design maturity.