If bean A actually depends on the initialization of bean B, you need it.
With @Startup, you make an impatient moment - a singleton is created at launch time, regardless of whether it is used.
In a lazy instantiation, a singleton is not created until its method is needed.
In both cases, the container can initialize beans depending on what it wants:
Sometimes, several single beans sessions are used to initialize data for an application, so they need to be initialized in a specific order. In these cases, use the javax.ejb.DependsOn annotation to declare dependencies for starting a single-user bean session.
source share