- Visibility Metrics and the Importance of Hiding Things
- Calculate metrics
- Controlling Access to Members of a Class
- py2neo
- List all the artifacts this notebook is based on
artifactName | packages | types | |
---|---|---|---|
0 | axon-disruptor-4.7.5.jar | 1 | 22 |
1 | axon-eventsourcing-4.7.5.jar | 9 | 130 |
2 | axon-test-4.7.5.jar | 8 | 85 |
3 | axon-messaging-4.7.5.jar | 61 | 729 |
4 | axon-modelling-4.7.5.jar | 10 | 149 |
5 | axon-configuration-4.7.5.jar | 1 | 39 |
A Java class or interface may be declared with the modifier public, in which case it is visible to all classes everywhere. If a class or interface has no modifier (the default, also known as package-private), it is visible only within its own package.
The relative visibility is the number of inner components that are visible outside (public) divided by the number of all types:
Using package protected types is one of many ways to improve encapsulation and implementation detail hiding.
The relative visibility is between zero (all types are package protected) and one (all types are public). A value lower than one means that there are types that are declared package protected. The lower the value is, the better implementation details are hidden.
Non public classes can't be accessed from another package so they can be changed without affecting code in other packages. They clearly indicate functionality that only belongs to one package. This also motivates to use more classes and to split up code into smaller pieces with a single responsibility and reason to change.
- Show relative visibility statistics aggregated for all packages per artifact
artifact | all | public | min | max | average | percentile25 | percentile50 | percentile75 | percentile90 | |
---|---|---|---|---|---|---|---|---|---|---|
0 | axon-configuration-4.7.5 | 39 | 26 | 0.666667 | 0.666667 | 0.666667 | 0.666667 | 0.666667 | 0.666667 | 0.666667 |
1 | axon-disruptor-4.7.5 | 22 | 9 | 0.409091 | 0.409091 | 0.409091 | 0.409091 | 0.409091 | 0.409091 | 0.409091 |
2 | axon-eventsourcing-4.7.5 | 130 | 95 | 0.500000 | 1.000000 | 0.769159 | 0.612903 | 0.785714 | 1.000000 | 1.000000 |
3 | axon-messaging-4.7.5 | 729 | 592 | 0.100000 | 1.000000 | 0.861211 | 0.750000 | 0.947368 | 1.000000 | 1.000000 |
4 | axon-modelling-4.7.5 | 149 | 128 | 0.500000 | 1.000000 | 0.804762 | 0.737500 | 0.813187 | 0.887255 | 1.000000 |
5 | axon-test-4.7.5 | 85 | 64 | 0.473684 | 1.000000 | 0.812336 | 0.650000 | 0.879167 | 1.000000 | 1.000000 |
- List the top 40 packages and their artifact with the highest relative visibility
artifactName | fullQualifiedPackageName | packageName | publicTypes | allTypes | relativeVisibility | |
---|---|---|---|---|---|---|
0 | axon-modelling-4.7.5 | org.axonframework.modelling.saga | saga | 30 | 30 | 1.000000 |
1 | axon-eventsourcing-4.7.5 | org.axonframework.eventsourcing.eventstore.jdb... | statements | 15 | 15 | 1.000000 |
2 | axon-messaging-4.7.5 | org.axonframework.serialization.upcasting.event | event | 12 | 12 | 1.000000 |
3 | axon-messaging-4.7.5 | org.axonframework.lifecycle | lifecycle | 10 | 10 | 1.000000 |
4 | axon-eventsourcing-4.7.5 | org.axonframework.eventsourcing.conflictresolu... | conflictresolution | 9 | 9 | 1.000000 |
5 | axon-messaging-4.7.5 | org.axonframework.common.property | property | 9 | 9 | 1.000000 |
6 | axon-messaging-4.7.5 | org.axonframework.messaging.interceptors | interceptors | 8 | 8 | 1.000000 |
7 | axon-messaging-4.7.5 | org.axonframework.messaging.responsetypes | responsetypes | 8 | 8 | 1.000000 |
8 | axon-messaging-4.7.5 | org.axonframework.commandhandling.distributed.... | commandfilter | 7 | 7 | 1.000000 |
9 | axon-messaging-4.7.5 | org.axonframework.serialization.json | json | 7 | 7 | 1.000000 |
10 | axon-messaging-4.7.5 | org.axonframework.eventhandling.tokenstore | tokenstore | 7 | 7 | 1.000000 |
11 | axon-messaging-4.7.5 | org.axonframework.serialization.xml | xml | 7 | 7 | 1.000000 |
12 | axon-messaging-4.7.5 | org.axonframework.tracing.attributes | attributes | 6 | 6 | 1.000000 |
13 | axon-messaging-4.7.5 | org.axonframework.eventhandling.scheduling.quartz | quartz | 6 | 6 | 1.000000 |
14 | axon-messaging-4.7.5 | org.axonframework.serialization.upcasting | upcasting | 6 | 6 | 1.000000 |
15 | axon-messaging-4.7.5 | org.axonframework.serialization.converters | converters | 5 | 5 | 1.000000 |
16 | axon-messaging-4.7.5 | org.axonframework.eventhandling.gateway | gateway | 5 | 5 | 1.000000 |
17 | axon-messaging-4.7.5 | org.axonframework.queryhandling.registration | registration | 5 | 5 | 1.000000 |
18 | axon-test-4.7.5 | org.axonframework.test.eventscheduler | eventscheduler | 5 | 5 | 1.000000 |
19 | axon-messaging-4.7.5 | org.axonframework.commandhandling.callbacks | callbacks | 4 | 4 | 1.000000 |
20 | axon-messaging-4.7.5 | org.axonframework.messaging.correlation | correlation | 4 | 4 | 1.000000 |
21 | axon-messaging-4.7.5 | org.axonframework.common.jpa | jpa | 4 | 4 | 1.000000 |
22 | axon-messaging-4.7.5 | org.axonframework.eventhandling.tokenstore.jpa | jpa | 4 | 4 | 1.000000 |
23 | axon-messaging-4.7.5 | org.axonframework.common.legacyjpa | legacyjpa | 4 | 4 | 1.000000 |
24 | axon-messaging-4.7.5 | org.axonframework.deadline.quartz | quartz | 4 | 4 | 1.000000 |
25 | axon-test-4.7.5 | org.axonframework.test.deadline | deadline | 4 | 4 | 1.000000 |
26 | axon-eventsourcing-4.7.5 | org.axonframework.eventsourcing.snapshotting | snapshotting | 3 | 3 | 1.000000 |
27 | axon-messaging-4.7.5 | org.axonframework.deadline.jobrunr | jobrunr | 3 | 3 | 1.000000 |
28 | axon-messaging-4.7.5 | org.axonframework.eventhandling.scheduling.job... | jobrunr | 3 | 3 | 1.000000 |
29 | axon-messaging-4.7.5 | org.axonframework.eventhandling.scheduling | scheduling | 3 | 3 | 1.000000 |
30 | axon-messaging-4.7.5 | org.axonframework.util | util | 3 | 3 | 1.000000 |
31 | axon-messaging-4.7.5 | org.axonframework.eventhandling.tokenstore.leg... | legacyjpa | 2 | 2 | 1.000000 |
32 | axon-messaging-4.7.5 | org.axonframework.messaging.interceptors.legac... | legacyvalidation | 2 | 2 | 1.000000 |
33 | axon-modelling-4.7.5 | org.axonframework.modelling.command.legacyjpa | legacyjpa | 2 | 2 | 1.000000 |
34 | axon-test-4.7.5 | org.axonframework.test.server | server | 2 | 2 | 1.000000 |
35 | axon-messaging-4.7.5 | org.axonframework.common.digest | digest | 1 | 1 | 1.000000 |
36 | axon-messaging-4.7.5 | org.axonframework.eventhandling.interceptors | interceptors | 1 | 1 | 1.000000 |
37 | axon-messaging-4.7.5 | org.axonframework.common.io | io | 1 | 1 | 1.000000 |
38 | axon-test-4.7.5 | org.axonframework.test.matchers | matchers | 23 | 24 | 0.958333 |
39 | axon-messaging-4.7.5 | org.axonframework.messaging.deadletter | deadletter | 18 | 19 | 0.947368 |
40 | axon-messaging-4.7.5 | org.axonframework.commandhandling.distributed | distributed | 24 | 26 | 0.923077 |
41 | axon-messaging-4.7.5 | org.axonframework.messaging | messaging | 32 | 35 | 0.914286 |
42 | axon-messaging-4.7.5 | org.axonframework.commandhandling | commandhandling | 26 | 29 | 0.896552 |
43 | axon-messaging-4.7.5 | org.axonframework.eventhandling.tokenstore.jdbc | jdbc | 8 | 9 | 0.888889 |
44 | axon-messaging-4.7.5 | org.axonframework.eventhandling.deadletter.jpa | jpa | 8 | 9 | 0.888889 |
45 | axon-modelling-4.7.5 | org.axonframework.modelling.saga.repository.jdbc | jdbc | 8 | 9 | 0.888889 |
46 | axon-modelling-4.7.5 | org.axonframework.modelling.command | command | 45 | 51 | 0.882353 |
47 | axon-messaging-4.7.5 | org.axonframework.common | common | 24 | 28 | 0.857143 |
48 | axon-eventsourcing-4.7.5 | org.axonframework.eventsourcing.eventstore.jpa | jpa | 6 | 7 | 0.857143 |
49 | axon-modelling-4.7.5 | org.axonframework.modelling.saga.repository.jpa | jpa | 6 | 7 | 0.857143 |