Results 1 to 20 of 20

Thread: Application architecture

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application architecture

    Quote Originally Posted by m15ch4 View Post
    Perhaps you could introduce some example applications organization. It would be very helpful and would look at the problem from another perspective (especially if you include a bit of pseudocode).

    Thanks for all answers.
    The example you provided is very good and most of apps i worked on were using the similar approach.

    Coming to the QApplication issue.
    Inheriting from QApp should be done when you want to extend the original class's functionality. For example QApplication extends QCoreApplication to provide GUI.
    Now lets suppose you app is requried to run in console mode, then you need to use QCoreApplication, which you cant because you are inheriting from QApplication.
    Similarly you cannot use other Classes like QtSignleApplication (inherites from QApplication), because now you have to change your MyApp code to inherit from QtSignleApplication.

    Furthurmore, you are designing you main Security class inherited from QApplication, which makes it Qt depended. All your serial generation/comparision etc should be independent of Qt to use in in any C++ as you mentioned.

    I can explain why your protection in main() is easy to defeat, but i dont think they are implemented as such in your real program.

  2. #2
    Join Date
    Jan 2010
    Location
    Poland Warsaw
    Posts
    25
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application architecture

    nish:
    instead of subclassing qapplication, why not have a seperate global class?
    Did you mean that instead of creating objects (MainWindow, DataProcess, DataAccess, ...) in the main.cpp file (or QApp class) we should create those objects in separate class (eg. Engine) which will be instantiated in main.cpp?

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application architecture

    not really. I already agreed that your design is good. Its just the case of Inheriting from QApp that is think should be revisited.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,328
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Application architecture

    Furthurmore, you are designing you main Security class inherited from QApplication, which makes it Qt depended. All your serial generation/comparision etc should be independent of Qt to use in in any C++ as you mentioned.
    I should make clear that all of the security functions -are- implemented independently of my LicensedApp class; this class -is- the Qt wrapper that gives access to the non-Qt security features and exists mainly to supply an event loop. These are in fact shared with non-Qt (e.g. MFC) apps.

  5. #5
    Join Date
    Jan 2010
    Location
    Poland Warsaw
    Posts
    25
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application architecture

    d_stranz:
    Sixth, I use Model/View components extensively. For each collection of information stored in the Document, there is usually a Model that serves as the interface between the Document and the table, tree, or other widget that displays it. These Models are owned by the MainWindow. Typically, the Document emits a "collectionChanged( const SomeCollection & )" signal, and the Model listens for it on a matching slot. The Model stores the pointer to the collection that is passed by the Document in its signal, and serves it up via the Model's data() method.
    Do you write your own Model classes or you use those from Qt (like QAbstractItemModel)? If your data is stored in custom collection, then you probably have to reimplement at least data() method to fit your data organization (in SomeCollection).

    I would be very thankful if you could explain this.

Similar Threads

  1. Replies: 0
    Last Post: 31st December 2010, 05:46
  2. Three tire architecture for database application ?
    By SudaNix in forum General Programming
    Replies: 1
    Last Post: 19th October 2010, 10:20
  3. Advice needed for QT application architecture
    By hubbobubbo in forum Qt Programming
    Replies: 0
    Last Post: 14th December 2009, 11:30
  4. Replies: 1
    Last Post: 16th September 2008, 17:29
  5. Application plug-in architecture
    By brcain in forum Qt Programming
    Replies: 3
    Last Post: 13th September 2006, 00:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.