Grouping classes in packages

what are the best strategies to group classes in packages, for example. all managers in one package, all tao in another, would you recommend a different approach?

Any good strategies?

+3
source share
3 answers

Classes with the same functionality should be placed in one package with the package name, which justifies their functionality and uses.

Example:

your.company.app.service

Must contain all service interfaces

your.company.app.service.impl

Must contain all service implementation classes

your.company.app.utils

Must contain all utility classes.

From the standard API

java.lang   — basic language functionality and fundamental types
java.util   — collection data structure classes
java.io — file operations
java.math   — multiprecision arithmetics
java.nio    — the New I/O framework for Java
java.net    — networking operations, sockets, DNS lookups, ...
java.security   — key generation, encryption and decryption
java.sql    — Java Database Connectivity (JDBC) to access databases
java.awt    — basic hierarchy of packages for native GUI components
javax.swing — hierarchy of packages for platform-independent rich GUI components
java.applet — classes for creating an applet

Cm

+3
source

Look at Uncle Bob's Photo Packaging Design Principles

+3
source

, , . , . :

/ graphic_interface

, , .

+2

All Articles