Where Should Zoom Functionality Live in a Web Editor’s Architecture?

0
5
Asked By PixelPioneer42 On

I'm working on a web editor using Canvas and I'm curious about where to categorize the zoom functionality within a clean architecture. Specifically, should zoom be part of the domain layer, application layer, or UI layer?

I have some thoughts: it might belong in the domain layer since the business rules revolve around coordinates, which could justify putting display limits, world focus, and zoom controls there. Alternatively, it could fit in the application layer as it might allow for a decoupling of domain logic from the display concerns. On the other hand, I see the argument for it being a UI layer issue because the zoom level influences how things are presented on screen, which can vary by display. Given the infinite nature of the workspace, that makes sense too.

I'm really stuck trying to figure this out, especially since information online isn't clear, and even AI isn't offering much help. If anyone has insights or can clarify this, I would really appreciate it!

3 Answers

Answered By DesignDude99 On

In my opinion, zoom is definitely a UI concern. When a user zooms in, the application should maintain its core functionality without any alterations. Think about it: when you're browsing the web, the backend and the HTML don’t change based on zoom preferences—it’s all handled by the browser's UI. So, it makes perfect sense for zoom functionality to be managed within the UI layer.

Answered By TechSavvyTom On

Zoom isn’t domain logic, for sure. The domain can manage constraints like world bounds and min/max zoom levels, but the application layer should handle the viewport settings and zoom applications. The UI layer is mainly responsible for rendering everything visually. Think of it this way: the application decides what's visible, while the UI layer deals with how it's displayed.

Answered By CoderChick88 On

Zoom should be part of the UI layer since it directly impacts how users interact with the interface. Even if it needs to communicate with backend components, that’s secondary. Don't overthink it—it's a minor detail that can be adjusted later if necessary. Focus on your larger project goals instead!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.