Menu
  • HOME
  • TAGS

Guice and restricting clients to getting only certain instances

java,guice,hexagonal-architecture

Ah, PrivateModule is one answer. One PrivateModule at the app level which exposes only the Admin interface: public class PrivateModuleTest { public static interface Admin {} public static class AdminImpl implements Admin { @Inject public AdminImpl(BusLogic x) {} } public static interface BusLogic {} public static class BusLogicImpl implements BusLogic...

Ports and adapters / hexagonal architecture - clarification of terms and implementation

architecture,hexagonal-architecture

inf3rno gave a good answer which clarifies the original question, but it may be useful to highlight some other uses for ports and adapters. According to my understanding the port is an expression of your interface. The port: Defines the exposure of the core's functionality (for 'incoming' ports) Defines the...

Where to apply domain level permissioning

design-patterns,permissions,authorization,onion-architecture,hexagonal-architecture

One could argue that access checking should always be as close to the code that performs the operation as possible to reduce the chance that someone can find a side-channel that bypasses access checking. That said, if you can use a wrapper class such that you guarantee that in the...