DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Posts
    4

    Should design classes from the outside or from the inside

    I am designing my c++ classes....

    Should I design my classes from the outside (interfaces first) or from the inside (data first)?
    ____luke

    wpdental - Santa Monica cosmetic dentistry.

  2. #2
    Join Date
    Nov 2003
    Posts
    4,118
    There's no one definitive answer to this, but usually, you start from the interface, which is the part that is less prone to changes, and then implement that interface in an iterative process until you're satisfied with the performance, reliability etc.
    Danny Kalev

  3. #3
    Join Date
    Dec 2003
    Posts
    3,366
    top down design makes the final, outermost layer highly structured and easy to use for any clients of a library or api or whatever. However it can be vague as you go deeper into the development -- issues creep in that can make the lower level classes not play well together (for example, A and B really should have been connected with inheritence but you have them seperated at the top level and cannot change it late in the development).

    Bottom up reverses this, the lower levels all play well but the top level interface may be clunky with seemingly redundant functions inherited up the chain or the like.

    There are other design methods however, look into extreme programming, design patterns and everything before choosing what is right for your application. It really matters what you are trying to do!

Similar Threads

  1. Database Design Help needed
    By Brian Pittman in forum Database
    Replies: 2
    Last Post: 04-29-2007, 08:23 AM
  2. Gradebook program
    By [gx]Shadow in forum Java
    Replies: 5
    Last Post: 10-25-2006, 10:20 PM
  3. Microsoft needs to visit Design school !
    By Franklin in forum .NET
    Replies: 3
    Last Post: 03-04-2002, 05:27 PM
  4. Data Type Mismatch
    By maria in forum VB Classic
    Replies: 0
    Last Post: 05-01-2001, 06:37 PM
  5. Design patterns
    By Ronadl in forum VB Classic
    Replies: 1
    Last Post: 09-15-2000, 05:56 AM

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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links