I have a software architecture question.
I have developped a dialog based application that reads a contactless card
and display its information(name, 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:CMyDialog()
{
m_csName = "";
m_csCompany = "";
m_csSerial=0;
m_Status = 0;
}
// called every second
void CMyDialog::OnTimer(UINT nIDEvent)
{
ReadContactlessCard()
DisplayInfo()
ArchiveInDB()
}
CMyDialog::ArchiveInDB
{
m_db.Archive(this); // 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?