Results 1 to 3 of 3

Thread: Circular referencing and seperation

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Circular referencing and seperation

    so this big project I have, I'm not able to really make it cleaner. Its VERY tightly coupled together.

    There is a "coreframework" project which contains heavily type of subclasses and inhertiences.
    in this project, it also uses the DAL. I'm trying to seperate this out and have this done.
    In this project also, there is some business logic. I'm moving this into a seperate layer altogether, which then communicates with the DAL.

    the main UI sometimes calls the DAL directly. so im almost finished seperating it out but with one big problem:

    there is another project called DBTypes. This has heavily decorated XML attributes for serializing/deserializing to an external webservice. In addition, a whole bunch of methods and properties that do some funky get/sets and raising events like OnPropertyChange, which is within a base class in the CoreFramework which then does some internal look ups and doing some other inhertiance type look ups and executions.


    I have a "Contracts" project which does NOT reference the coreframework. I dont want it to. The project contains pretty much like DTO type objects, just simple get sets.
    This is what I want to pass into the service layer (middle tier) so it can then serialize and call the external webservice. That's cool.
    The problem then is returning data back. It needs to be of the same type as the DBTypes project as when its setting things, it does the "funky" stuff to set the object correctly. The DTO returning back is not good enough at all and makes the crux of the application basically stop working.

    I cannot add a reference from "Contracts" TO DBTypes because of circular reference (indirectly). The circular reference comes from the CoreFramework referencing Contracts, the DBTypes referencing CoreFramework.

    what can I do? This is seriously giving me a headache. when you are almost "there", then another whole issue begins.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  2. #2
    PowerPoster Evil_Giraffe's Avatar
    Join Date
    Aug 2002
    Location
    Suffolk, UK
    Posts
    2,555

    Re: Circular referencing and seperation

    You'll need to move the "setting of funky stuff" out of Contracts (why is it in there anyway?).

    Or is the Contracts receiving one of these objects? If so, try extracting an interface that the DBTypes and Contracts can both reference. The DBTypes types implement the interface and the Contracts project can then use the interface and not need a reference to the DBTypes project.

    Alternatively, fix the rest of the program so that the DTO can be returned to Contracts?

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Circular referencing and seperation

    Cannot do that either as it breaks everything...and moves it out of the focusgroup, for the lack of a better word.

    Believe me I've exhausted all the options with lots of trial and massive errors....the only way was to make a post build copy for the 2dlls in question and then add a reference to them....I hate that because it entices people into the bad habits again but it does work.

    Hmph

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width