Difference between Adding objects and just referencing it

Hi community,

I do not understand the different use cases for adding objects to an specific application or just referencing it (e.g. in an expression).

Assume we habe 2 applications:

  • app AAA
  • app BBB

Both use onjects from a a "shared" application "ZZZ" providing core functionality (e.g. an interface and other to manage comments)

Let's say I want to use some commenting functionality in app AAA.

My approach would be to just "use" (reference) the objects from the commenting app, but definitely NOT adding these objects to application AAA.

Yet I have seen implementation where (in app AAA) some objects, e.g. ZZZ viewComments are added to the application using the same object in multiple applications.

I would assume it would be a good idea to keep each application as isolated as possible.

Thank you for some explanation!


  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    It depends a lot on the preferences / standards set by and used by your dev team, and your desired application hierarchy and desired level of independence.

    By default, your original assumption is generally considered correct - if you use a common object from app ZZZ in app AAA, you would just let the ZZZ object sit in app ZZZ.  Generally speaking you would need to make sure that ZZZ objects are updated and deployed across your target environments before use (or at least before AAA gets deployed) - consider the use cases where ZZZ isn't actually promoted to PROD yet, or perhaps the particular rule or object you reference from ZZZ is either newer or newly updated.  These are easy situations to handle, of course, but need to be kept under consideration.

    Sometimes in my personal development, while working on a ticket, I have reason to add shared objects that are perhaps under the scope of a higher-level app in the hierarchy.  I tend to develop in app packages that are ticket-specific much of the time, and in these cases I'll add or update higher-level objects directly into the ticket application (often simultaneously adding them to their "main" application as well, if needed).  The difference of course is that these applications are transient in nature and in the end, it'll matter less that there are cross-app objects.

    Generally speaking and from a purely high-level technical standpoint, of course, it doesn't really matter how many apps a single object is in - they're all treated the same.  So from that standpoint it doesn't matter as much whether objects are added to apps or not - the difference is down to how you need to keep things organized for your own purposes.

  • Mike,

    thank you a lot for this great answer.

    This helped!


Reply Children
No Data