The goal of this proposal is to define clear lines between modules of geode, so that each piece can be tested independently by mocking out the other modules.
In order to accomplish that goal, each module needs to have a clear API for the rest of the system to use, and tests within that module that cover all of the features of the API.
Here's a start at listing the modules and their dependencies.
PlantUML |
---|
@startuml package WAN { } package CacheServer { } package Client { } package Regions { } package Querying { } package Persistence { } package Statistics { } package Messaging { } package Advisors { } WAN --> CacheServer WAN --> Client WAN --> Regions CacheServer --> Regions Client -->Regions Regions-->Persistence Regions-->Statistics Advisors-->Messaging Regions-->Advisors Querying-->Regions Regions->Messaging |
Each module should have at least it's own package(s), if not be in a separate gemfire- gradle module. Anything that is not part of the API for that module should only be package visible.
Here is a high level view of the interfaces for each module and some of the changes that need to be made
Statistics
Package:internal.statistics?
API interfaces/classes: Statistics, StatisticsFactory, StatisticsManager
Required changes: Move into a separate package. Pull the code out of InternalDistributedSystem (it currently implements StatisticsFactory) into a separate class.
Messaging
Package:distributed.internal?
API interfaces/classes: InternalDistributedMember, DM, InternalDistributedSystem, MembershipListener
Required Changes: InternalDistributedMember and InternalDistributedSystem should be interfaces, not concrete classes. They should only have the methods that are required by the rest of the system.
Persistence
Package: internal.cache.persistence
API interfaces/classes: InternalDiskStore, DiskStore, DiskRegionView, DiskId
Required Changes: InternalDiskStore is new interface.