473,812 Members | 3,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

architecture design

I have a software architecture question.
I have developped a dialog based application that reads a contactless card
and display its information(nam e, company, ...).
So basically I have a CDialog (Windows - MFC) and I would like to save the
information read inside a database (SQLite).

SO I have choosen this architecture :

..cpp
CMyDialog:CMyDi alog()
{
m_csName = "";
m_csCompany = "";
m_csSerial=0;
m_Status = 0;

}

// called every second
void CMyDialog::OnTi mer(UINT nIDEvent)
{
ReadContactless Card()
DisplayInfo()
ArchiveInDB()
}

CMyDialog::Arch iveInDB
{
m_db.Archive(th is); // m_db is an object for a class (CMyDB) used to
handle sqlite database
}

My problem is someone told me that it is not a good design to have a
circular dependency. I mean I declare
a CMyDialog with a CMyDB object and I pass to the CMyDB object a pointer to
the CMyDialog.
How can I do differently?


Jul 22 '05 #1
1 1397
Vince wrote:
My problem is someone told me that it is not a good design to have a
circular dependency. I mean I declare
a CMyDialog with a CMyDB object and I pass to the CMyDB object a pointer to the CMyDialog.
How can I do differently?


Use the technique that /Large Scale C++ Software Design/ calls "escallate
the dependency", and /Agile Software Development: Principles Practices and
Patterns/ calls "Dependency Inversion Principle".

Pass to the CMyDB an abstract base class, containing only those few methods
that the DB layer will use, expressed as pure virtual member functions. Then
CMyDialog inherits this class and implements the methods.

Your friend needs to understand that "isolating changes" is what makes a
design good. Breaking up circular dependencies is a good way to achieve
that, but otherwise if they happen then they happen.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 22 '05 #2

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

Similar topics

3
2615
by: Michael Crawford | last post by:
Hi, Where would one start for this type of application: I want to create an vb.net container application that has the gives the end user the ability to install and uninstall plugins or add-in modules. As the user installs the various components, additional functionality to the application is integrated. How would I structure or orchestrate a project plan that makes use of add-in
25
5631
by: David Noble | last post by:
We've been developing a web site using 3-tier architecture for 18 months now. There is a common layer that defines the classes - using XML schemas. The data layer acts as a wrapper to 3 databases - SQL Server, Oracle and AS400. The business layer exposes web services which communicate with the front end, ASP.Net. All 3 tiers are on different boxes. This works well. Now I am leading a team to build a winforms app. I need some advice as
6
2956
by: Gary James | last post by:
This may not be a direct C# question, but since I'll be using using C# for development, I thought I'd pose the question here. I'll soon be involved in the design of a new software product that will employ a software "Plug-In" architecture. Taking the plug-in route will give us a design that can adapt to, as yet, undefined future requirements (within the scope of the plug-in interface spec of course). In the past I've done this with...
6
1410
by: V. Jenks | last post by:
I apologize if this is the wrong forum for this, I could not locate one that was exactly appropriate for this topic. Over the last couple of years I've been doing a lot of reading on design patterns and different types of architectures for building high-performance, scalalble n-tier apps. I've used business objects for a while, since moving to C# and asp.net from classic asp but I'm wondering how I can
4
2310
by: Nick Goloborodko | last post by:
Hi, I'm in the process of conceptualizing a new ASP.NET application. I'm a relative newbie in ASP.NET / .NET in general, so any comments will be greatly appreciated. Basically i need to make my application as modular as possible, something along the lines of Mambo (PHP CMS System) Drupal (another PHP CMS) or something similar to these. What I'm thinking is to provide the following structure: core of the application includes essential...
6
2168
by: Chad Grooms, MCSD >> [VB.NET,C#,ASP.NET] > [VB.NET | last post by:
Hey all, I have a few questions regarding .NET BLL design. I am a somewhat self-taught developer with limited resources, so I know there are some concepts here and there that I might have missed along the way. To understand my question, it might be best for me to explain my situation...I'll try to keep it short. :) Currently, I explicitly define classes for each object I have created, and mirror this design in the database. For...
5
2376
by: Ludwig Wittgenstein | last post by:
Other than the Design Patterns book, which book(s) is/are the best to learn object-oriented software design/architecture from ?
0
1491
by: Joerg Rech | last post by:
Dear software practitioners, consultants, and researchers, we are currently conducting an international survey about architecture and design patterns. Our goal is to discover how familiar people are with these patterns (and anti-patterns) as well as to elicit the information need, the usage behavior, and the experience of software organizations regarding architecture patterns and design patterns.
0
1614
by: Joerg Rech | last post by:
Dear software practitioners, consultants, and researchers, we are currently conducting an international survey about architecture and design patterns. Our goal is to discover how familiar people are with these patterns (and anti-patterns) as well as to elicit the information need, the usage behavior, and the experience of software organizations regarding architecture patterns and design patterns. Therefore, we would like to invite you...
1
2345
by: abhijitbkulkarni | last post by:
Hello, I am designing a .NET database application that uses 3 tier architecture. Starting initially, this application will be desktop application but I will convert it into a website later but design that I am planning should support both version. Development Environment : VS2008, C# Currently Database supported are MS SQL Server 2005 and MYSQL 5 and design for database support is extensible. This application contains several high...
0
10664
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10404
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10417
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10139
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9220
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5568
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4357
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.