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)?
- Santa Monica cosmetic dentistry.
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.
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!
By Brian Pittman in forum Database
Last Post: 04-29-2007, 08:23 AM
By [gx]Shadow in forum Java
Last Post: 10-25-2006, 10:20 PM
By Franklin in forum .NET
Last Post: 03-04-2002, 05:27 PM
By maria in forum VB Classic
Last Post: 05-01-2001, 06:37 PM
By Ronadl in forum VB Classic
Last Post: 09-15-2000, 05:56 AM
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