Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4071964
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:49:26+00:00 2026-05-20T16:49:26+00:00

Sorry this is a very newbie question. We have this massive application I am

  • 0

Sorry this is a very newbie question.

We have this massive application I am doing maintenance on. It has 5 different forms. We put our global variables in one unit (uGlobal). But i can’t seem to access it from the data unit (uData).

I have this:

Unit uGlobal
type
TmyType: (alpha, beta);
...

Unit uGlobal

Stuff:  TmyType  <- error, undeclared indentifier

When i try to put uGlobal in the uses section of uData, it complains of a circular reference. So, kinda clueless here. They are both in the same project. This is using BDS 2006.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T16:49:27+00:00Added an answer on May 20, 2026 at 4:49 pm

    You have a circular reference because you have things in uGlobal that want to make use of things in uData and vice-versa. Circular references are a big concern in large projects because they greatly increase complexity – if you have circular dependencies, it becomes more like one BIGGER unit. I suspect you have a long way to go before your project can be considered large, let alone “massive”. 😉

    You have 2 possible solutions:

    • Go with the circular dependency, making one dependency weak, and the other strong.
    • Apply a little redesign to eliminate the problem alogether. (Break things into smaller chunks.)

    Keeping the circular dependency

    David has already given the answer: At least one of the units must use the other from the implementation section.

    • A uses B uses A is absolutely not allowed, but you can think of the interface and implementation sections as being almost like separate units themselves (with a bunch of special referencing rules).
    • So ask yourself what does each sub-unit need?
    • If for example:
      • You declared a type in uData interface and referenced that in uGlobal interface, then the interface of uGlobal needs uData and will need a corresponding uses clause.
      • If there’s a type in uData implementation that’s referenced in anywhere uGlobal, then that declaration in uData implementation must be moved to the interface section.
      • If there’s a type in uGlobal interface must it’s only referenced from the implementation section of uData then that uses clause will be fine in the implementation section.
    • If you have the unfortunate situation that types in both interface sections reference types in the other interface section, then you have to to modularise a little more by applying the technique to Remove Circular Dependency.

    Remove Circular Dependency

    Removing the circular dependency requires breaking your units down into smaller ones that are more manageable. To do this, you must understand the dependencies between each of the things in your application.
    For example:

    • Suppose uGlobal declares A and C
    • A depends on C, but C doesn’t need A
    • Suppose also that uData declares B which needs C
    • But it turns out that A also needs B
    • This is why you have the circular dependency

    All you have to do in this case is declare a new unit at move C in there.

    • Then both uGlobal and uData will use uNewUnit
    • But neither will need the other
    • And your circular dependency will be removed entirely.

    Disclaimer

    I am not in any way advocating your approach with uGlobal. In fact it is a very bad idea and will bite you big time on 2 fronts when your projects starts to get large. Unfortunately the explanation is a mammoth answer in itself.

    • Use of global variables at all is dangerous and to be avoided.
    • Use of ‘big dumping units’ like uGlobal and uData is also dangerous, and you’ve only just satrted to experience their problems.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sorry for this very newbish question, I'm not much given into web development.
Ok sorry this might seem like a dumb question but I cannot figure this
Sorry for this not being a real question, but Sometime back i remember seeing
Sorry if this sounds like a really stupid question, but I need to make
Sorry if this is a comp-sci 101 question. I'm just unsure if I'm missing
Sorry, if this is a noobish question, but I'm just getting started with Rails
Sorry, I thought this was an inheritance question: it was an ArrayList question all
Sorry I couldn't find the best heading for this question. Following is my requirement.
Sorry if this is a little off-topic for regular stackoverflow questions, but we're tearing
Sorry for the Windows developers out there, this solution is for Macs only. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.