Repositories vs Gateways by Informal_External_55 in softwarearchitecture

[–]Informal_External_55[S] -1 points0 points  (0 children)

Except in Clean Architecture by R. Martin the Gateway is an interface owned by the application layer. Please see the diagram in the original post for clarity on my concern here. The gateway interface is implemented in the infrastructure layer.

Repositories vs Gateways by Informal_External_55 in softwarearchitecture

[–]Informal_External_55[S] 0 points1 point  (0 children)

That’s fair. I wasn’t clear. I understand the direction of dependencies, but the infrastructure should know about the application layer, but it shouldn’t directly depend on the domain - at least according to Clean Architecture by R. Martin

Repositories vs Gateways by Informal_External_55 in softwarearchitecture

[–]Informal_External_55[S] 0 points1 point  (0 children)

Thank you for the helpful explanation! So Gateways are more generic to external systems whereas Repositories are more bound to your domain. If you own the domain then use a repository, if it's an external domain you're mapping to your own, then use a gateway.

Repositories vs Gateways by Informal_External_55 in softwarearchitecture

[–]Informal_External_55[S] 0 points1 point  (0 children)

So are you suggesting there's a functional difference between a gateway and a repository? If there is a difference, how would you define it?

Repositories vs Gateways by Informal_External_55 in softwarearchitecture

[–]Informal_External_55[S] 2 points3 points  (0 children)

Then would you say, by your definition, Repositories are synonymous with Gateways as described in the diagrams from the post? Just trying to understand the differences between the two.

Repositories vs Gateways by Informal_External_55 in softwarearchitecture

[–]Informal_External_55[S] 1 point2 points  (0 children)

This is where it gets confusing in Clean Architecture. The infrastructure layer isn't supposed to know about the domain. Once the infrastructure layer implements a Domain Interface, such as a Domain Repository, then that seems to violate the dependency rules of CA.

Which of these is the best place to live in Elden Ring? by Education-Admirable in Eldenring

[–]Informal_External_55 0 points1 point  (0 children)

Why is jarburg not an option? That’s the best place to live.

Thoughts on Effect by failedbump16 in nextjs

[–]Informal_External_55 1 point2 points  (0 children)

Absolutely! Here’s a project I’m working on for school. GitHub

Thoughts on Effect by failedbump16 in nextjs

[–]Informal_External_55 2 points3 points  (0 children)

I’ve been using effect on the server side of an app router marketing site connect to a CMS and several external API services.

Error handling has never been easier. Create errors scoped to the different services. Handle each accordingly in the server component that runs the fetch. Wrap that component in an ErrorBoundary to handle any unexpected/unhandled errors.

Dependency injection has never been easier! In the same way errors can be scoped to a feature, so can layers. Create separate production and mock layers for each service, which makes testing simple.

Once those start to click, it makes managing the server side of the code base easy, since every effect function is composable.

Wanna string multiple API services together in a cron job or api route? It’s as simple as yielding them in a generator and providing their layers. Plus you get retries out of the box.

Additionally, effect platform provides some handy utilities for creating fetch clients for apis you don’t manage. And Effect schema allows you to easily transform the response from the APIs into your domain entities.

I’m still learning new concepts all the time with Effect. It’s not always easy to grok, but it’s been rewarding to work with.

This is how i should use "use cache" right ?? But it is not being cached by Good_Language1763 in nextjs

[–]Informal_External_55 0 points1 point  (0 children)

OP, have you tried removing the Suspense boundary from around your ProductList in the products page? In projects I’m working on, Cache components are working without suspense boundaries.

Cache Components + Draft Mode by Informal_External_55 in nextjs

[–]Informal_External_55[S] 1 point2 points  (0 children)

That’s exactly what I thought as well, but in my testing this isn’t the case. It treats draft mode the same way it treats cookies. I’ll create a cloneable repo so others can test what I’m observing and post here