Skip to content

test and document co-dependent classes #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 3, 2025

Conversation

brettmc
Copy link
Contributor

@brettmc brettmc commented Apr 3, 2025

  • Test co-dependent classes, A::createB() and B::createA().
  • Add a test to demonstrate how it works.
  • Document

@brettmc
Copy link
Contributor Author

brettmc commented Apr 3, 2025

This method of implementing co-dependent classes is pretty clunky, and mostly to illustrate the problem. I will try to come up with a more ergonomic solution. It's useful to know that it can be done now (even without the macro, I just added that to simplify the usage)
edit: the no-macro version is not actually that bad: 7c2813c

@jmjoy
Copy link
Member

jmjoy commented Apr 3, 2025

You can just write:

const A_CLS: &str = r"IntegrationTest\Dependency\A";
const B_CLS: &str = r"IntegrationTest\Dependency\B";
// Build both class entities
let mut a_cls = ClassEntity::new(A_CLS);
let mut b_cls = ClassEntity::new(B_CLS);

let a_bound_class = a_class.bound_class();
let b_bound_class = b_class.bound_class();

brettmc added 4 commits April 3, 2025 21:10
@brettmc brettmc changed the title demonstrate co-dependent classes test and document co-dependent classes Apr 3, 2025
@brettmc brettmc marked this pull request as ready for review April 3, 2025 11:03
@jmjoy jmjoy merged commit 1f88d5c into phper-framework:master Apr 3, 2025
22 checks passed
This was referenced Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants