STRUCTURING YOUR APPLICATION
So far, your application bundles have been entirely isolated within the runtime.
Clearly this works, but it isn't the best way to share code or reduce your runtime foot-
print. What you want to do is isolate the core content while sharing the API and library
code. To do this, the first thing you need to do is look at the application to identify the
bundles that can be safely removed.
As you can see from figure 4.8, the bundles in your application are interconnected.
At first glance it may seem as though all the bundles represent core content; how-
ever, looking deeper, this isn't quite correct. Core content bundles typically expose an
endpoint (like a WAB ) or provide an implementation of a service used within the
application. In this case, the Fancy Foods API bundle does neither; it exposes packages
to the implementation bundles, making it an excellent candidate for sharing.
Now that you've identified that the API bundle doesn't need to be isolated, but that
the rest of the bundles do, you have two options. One option would be to add the API
bundle to a repository and remove it from the EBA . This would mean it was no longer
Fancy Foods web
Figure 4.8 The relationships between bundles in your EBA. All of the bundles have a package depen-
dency on the API bundle. The two department bundles expose services that are consumed by the busi-
ness bundle. The web bundle consumes services from the business and persistence bundles indirectly,