liveBook · Manning

Circular reference

A circular reference is a cycle of direct or indirect references among objects, components, or resources, in which following the references eventually leads back to something already encountered.

How 3 Manning books explain it

Pro ASP.NET Core 7, Tenth Edition

A circular reference is a chain of object references in which an object is eventually referenced again, forming a cycle.

How it is used
Diagnoses JSON failures when ASP.NET Core web-service responses expose Entity Framework Core related data.
How deep it goes
Explains navigation-property tracking, demonstrates the failing request, and shows manually nulling back-references before serialization.
Examples
Uses Supplier and Product entities, an Include query, the /api/suppliers/1 endpoint, and a foreach back-reference removal.
What you can do after
Diagnose serialization failures and break response cycles by removing child-to-parent references before returning related data.

Read how Pro ASP.NET Core 7, Tenth Edition explains circular reference →

The Well-Grounded Python Developer: How the pros use Python and Flask

A circular reference problem is a dependency structure in which modules directly or indirectly require each other in a cycle that prevents valid importing or initialization.

How it is used
Prevents module-import cycles when Flask features need access to the central app instance.
How deep it goes
Explains the dependency structure and gives a package-and-factory remedy, without descending into Python import internals.
Examples
Uses a MyBlog app.py layout, a package directory tree, create_app(), and Flask command-line launch examples.
What you can do after
Diagnose/debug with it by recognizing import cycles and restructuring Flask code around a package and factory.

Read how The Well-Grounded Python Developer: How the pros use Python and Flask explains circular reference →

100 C++ Mistakes and How to Avoid Them

A circular reference is a cycle of object references in which objects eventually refer back to an earlier object in the cycle.

How it is used
Warns against using shared ownership in both directions when designing linked structures and managing dynamic resources.
How deep it goes
Explains reference-count failure and recommends weak pointers, stopping short of a complete corrected implementation.
Examples
Uses a deque whose nodes contain shared prev and next pointers as the concrete circular-reference example.
What you can do after
Diagnose ownership cycles and select unique or weak pointers to prevent shared resources from leaking.

Read how 100 C++ Mistakes and How to Avoid Them explains circular reference →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.