473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Am i using interfaces correctly?

I am building a multi project C# program that draws graphic objects.

These objects are created in the business layer, there is also a collection
class that handles adding new objects and pushing changes back to the data
layer. So far so good.

Now I am working on the GUI layer. All my GUI components needed to refer to
the collection, so that they know what to draw.

I am trying to isolate the GUI layer as much as possible, but as I said,
some of the components need to see the collection. There are more than one
component that needs to see the collection, so I thought it would be good to
create a GUI level Singleton object that housed the collection, I describe it
as a "Singleton facade". While I think this correct, I would welcome
comment....

This GUI level singleton object needs to be accessed by each layer (the
buiness and GUI).

In order for the business layer to access the "singleton facade", that layer
needs to reference the facade in the GUI layer. At the same time, the
"singleton facade" needs to know about the graphic objects and their
collection object so that it can deal with these objects.

Entering both of these references, in the IDE, creates a circular reference
error.

So I created interfaces that define the base level objects (collection and
each object in the collection). These interfaces are created in a "Shared"
project which each of the two other projects, the "Singleton Facade" project
and the Business layer project, refer to the shared project to pick up the
interface definitions.

This seems to be working. Am I doing this right?

Has anyone done anything like this?

Thanks,

Bob Maxey
Nov 17 '05 #1
1 1268
Hi Bob,

If the singleton facade it has to be referenced by all other components.
However, in my point of view, the business logic layer should not reference
the singleton facade, as what business logic deals with has nothing to do
with the GUI. It has to be the singleton facade that references the
business logic. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Geoff Pennington | last post by:
Is there an easy way to find out what classes implement a given interface? For example, it might be useful to know what classes implement ICollectible. Much obliged, Geoff.
0
by: Horia Tudosie | last post by:
Using Visual Studio 2003 This is to report a series of bugs regarding the FlagsAttribute and (independently) the usage of interfaces in Web applications. Let’s declare xColors type like: ...
5
by: dj | last post by:
I know seasoned OOP-savvy developers will roll their eyes at this one, but can anyone provide a clear explanation as to *why* one would need to use an Interface in a VB.NET application? Every...
3
by: Michael Hoehne | last post by:
Hi, I'm currently facing a problem with a mixed environment using .NET 1.1 and ..NET 2.0 web services. We have a client application (the "client", system 1) running on .NET 2.0/WinXP, calling...
6
by: Jeff S | last post by:
How do interfaces help us achieve separation or reduce dependencies between classes? Suppose I have a "PersonPresenter" class and want to enable its data to be editable in a Form. I have read...
8
by: Dave | last post by:
I have a set of developers who have gone off and implemented an interface for nearly all classes in a project\solution, now some of these classes will need interfaces as they implement the provider...
22
by: RSH | last post by:
Hi, I have been reading on interfaces working on samples I've run across on the web. For the life of me I cannot seem to grasp them. It appears to me that interfaces are simply blueprints to...
27
by: jm | last post by:
I am having trouble understanding the purposes of an interface, even though the concept of interfaces is around me all the time (user interface, for example). I'm just not understanding software...
26
by: Chris Becke | last post by:
Given an interface (in the c++ sense, nothing more than a struct containing pure virtual methods) struct Iv1 { virtual method0()=0; }; And a class that implements the interface class...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.