Update ARCHITECTURE.md with latest revisions and high-level proposed HTTP approach#46
Conversation
… generic interface as return type to be future proof.
…correctly define ID and name return types as string or null.
|
@JasonTheAdams Let's discuss the minor differences between your proposed HTTP architecture outline in trunk...add-http-client-and-auth and what I have here:
Let me know your thoughts on these changes. FWIW I also revised |
|
Hi @felixarntz! 👋 I had a feeling you'd want to move One thing I was debating is whether it simply makes sense to update our Otherwise, I'm good with everything you're describing add/modifying! 👍 |
I'd prefer keeping them decoupled. Since the conversion between our DTOs and their PSR-7 equivalents is only relevant at the transporter layer, I think it's enough of an implementation detail that it shouldn't cause relevant overhead. But decoupling ensures that we have full control over the shape of our DTOs, while being PSR-7 interoperable via conversion. I think it's also a bit more flexible and future-proof as we could dynamically convert our DTOs to different PSR-7 interface implementations depending on what's available (e.g. Guzzle or something else). |
That's fair. It certainly does keep our DTOs simple and specific to our needs.
I don't think this is exactly true. Guzzle and such don't really care so long as they use PSR-7 interfaces. We don't need to worry about converting to different PSR-7 implementations, as that's the point of PSR-7. Other libraries would do what we're doing and convert to/from their own objects. Not using PSR-7 on our objects really only has the benefit that we don't have extra methods. I don't think it makes any difference with how we interface with the client libraries. So either we implement PSR-7 |
I partially agree. Guzzle itself doesn't care what you pass, but still Guzzle also has its own implementation, see e.g. https://github.com/guzzle/psr7/blob/2.7/src/Request.php. So we could also use whichever PSR-7 request implementation is present instead of more or less writing the same code ourselves.
I'd prefer the conversion steps approach, just because it keeps our code more independent. For instance, I don't love that PSR-7 requires a |
|
I'm cool with the conversion strategy! 😄 Regarding Guzzle, I feel like we agree and are somehow talking around each other. Hahah! In any case, yes, PSR-7 with the discovery system for Guzzle (and other) integration via PSR-17 and PSR-18. I think what I built in #47 moves us in that direction. 👍 |
This PR revises a few things in
ARCHITECTURE.md, partially in accordance with revisions already implemented, partially as a proposed approach based on recent conversations about the HTTP infrastructure layer.Here's a breakdown:
Note: There are 3 very minor fixes in actual code files that I noticed were needed while reviewing the architecture diagram.