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

  • SEARCH
  • Home
  • 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 3431374
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:19:06+00:00 2026-05-18T07:19:06+00:00

I have created a win form solution in C#. The solution has three projects,

  • 0

I have created a win form solution in C#. The solution has three projects, front layer (FL) business layer (BL) and data layer (DL).

Front layer has all forms. All of the forms implement IForms interface
Business layer has all business logic. All of the business logic classes implement IController interface
Data layer has all data logic that communicates with the sql database. All of the data logic classes inherit IModel interface

I am trying to use MVC design pattern but I am struggling a bit.
Target: Call a method in a class of BL, when I press a button in a form.

If I add BL dll to FL, then I can call the methods of BL.

BL.Class classObject = new BL.Class(this);
classObject.CallMethod();

In the BL, I want to have the reference of the object that called the method so I tried to add reference of the FL dll but it says Circular dll reference.

I want to have a constructor in the BL class:

public BL.Class(IView view)
{
MessageBox(view.Name);
}

How do I architect my solution to achieve this? Please note that the solution is big so I cannot merge all classes into one dll.

Take care,
FM

  • 1 1 Answer
  • 1 View
  • 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-18T07:19:06+00:00Added an answer on May 18, 2026 at 7:19 am

    You can define events in BL for FL to register. Whenever there’s a change in the model, BL should fire an event. It’s up for the view to handle it.

    Your BL is created a message box. What if your view is a WebForm? BL shouldn’t know the detail of view.

    Also, your BL project shouldn’t have a dll reference to FL. You need to declare IView in BL, not FL.

    EDIT:
    This is the structure I used before. Your BL defines the interface. Your view has to implement the interface if it wants to use the BL. BL uses the interface to interact with the view. This way, you can build different views that use the same BL.

    BL.dll

    public interface IView
    {
        /// <summary>Update the view</summary>
        void UpdateView(object myBusinessObject);
    
        /// <summary>Display message</summary>
        void ShowMessage(string msg);
    }
    
    public class BL
    {
        // Model and View
        private IView _view;
    
        /// <summary>Constructor</summary>
        public BL (IView view)
        {
            _view = view;
        }
    
        public void foo()
        {
            // Do something
    
            // Show message
            _view.ShowMessage("Hello World");
        }
    }
    

    FL.dll

    public class FL
    {
        private BL _myBL;
    
        /// <summary>Constructor</summary>
        public FL ()
        {
            _myBL = new BL(this);
        }
    
        /// <summary>Handles user event</summary>
        public void handleEvent()
        {
            // Call BL to do something
    
            _myBL.foo();
        }
    
        public void UpdateView(object myBusinessObject)
        {
            // Update your view
        }
    
        public void ShowMessage(string msg)
        {
            // Display message to user
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple problem: I have a main form in win-forms/c#. It has
I have created a simple win 32 application..in which it has a textbox and
I have a win form that creates a site in IIS7. One function needs
I have created an EDMX in visual studio 2010 SP1. It has been built
I have a winform application and this winform application has created few files. I
I have created a VB.NET program using windows forms. The program runs on a
here at home I have different projects and libraries for which I've created an
I have a win form app with a listbox displaying methods (by attribute). I
I have a solution with two web applications/projects. Both start up on F5 but
I created a Flash application that reads POST data from a form. A user

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.