473,320 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

top down vs. bottom up

what is the main difference between top down approach of programming &bottom approach of programming?



Is there any difference in main function in c & c++ either during compilation or someother way
Jul 28 '07 #1
3 15974
RedSon
5,000 Expert 4TB
Moving to the general software dev forum. also changing the name of the post since "c/c++ query" is not a descriptive thread name. You should probably read the posting guidelines found under the help link at the top of this window.
Jul 28 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
Top-down programmong (also called structured programming) consists for writing functions that call other functions until the code becomes obvious.

A program might read a disc file, do some processing, and display an output.

Top-down might be:

Level 1
Call Read
Call Process
Call Display

Level1 (for Call Read)
Call DoesFileExist
yes Call OpenFile
no Call ReturnError

Level 2 (for CallOpenFile)
Call DoesFileExist
yes. open file and return
no. rerturn error file does not exist

etc...

This is the classic C program.

Bottom-up propgramming has you write functions without knowingn how they will be used. Typically, this will be a class with member functions. In the above example, you may have a File class with an OpenFile method. You can write the class and the method without needing to know how the object will be used.

The theory is that by writing classes that interact with other classes you will have created program building blocks that can be used in many programs.

Top-down is usually a throw-away and record from scratch when modifications are needed. Top-down code is tightly intertwined. Often this is called monolithic code (one block of stone).
Jul 29 '07 #3
sisir
1
Top Down Approach
What is Top Down Approach? Top Down approach is to start implementing Presentation Layer and then implement the Business Logic.

Advantage:
• Easy to visualize functionality.
• Sense of completeness in the requirement.
• Easy to show the progress of development.
Disadvantage:
• UI driven approach hence high possibility of redundant business logics.
• Since an UI is readily available no developer would write a Unit test cases.
• No Concrete layer to rely on, as both presentation & Business Logic keep evolving.
• Lack of concrete test suits to ensure one layer is tied up.
Bottom Up Approach
What is Bottom Up Approach? Bottom Up approach is to start with the concrete business logic and its testcase and proceed with presentation Implementation.

Advantage:
• Solid Business Logic, hence zero redundancy
• Good Unit test case can be written to validate changes.
• Developer has only option to use unit testing tools to test the Logic.
• Easy to manage changes and modification.
Disadvantage:
• Effort involved to write test cases.
• Progress of implementation cannot be show very effectively.

Conclusion
As the number of tier & layers getting more and more, the amount complexity due to loose coupling also increases. Business logic is one which need to be concrete, testable and manageable. There is no right or wrong in these approaches, but business logic is heart of any modern day or traditional applications. If one has a concrete business logic, it's easy to provide a UI to manipulate the same (UI Developer's excuse me for that, this my perspective).

Note: I prefer the Bottom Up approach, and i feel lot more comfortable and confident that my one end it tied up, and i need not worry about it.
Aug 8 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

82
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | ...
5
by: Analysis&Solutions | last post by:
Hey Folks: I'm probably dreaming here, but perhaps there's a way... I just gave a presentation. It's in XHTML and uses CSS for making things look nice. Right now there's a small navigation...
13
by: Michael Hill | last post by:
I have created a test page with a window in it created by using divs, but I haven't figured out how to move the "down arrow" to the bottom of the main div. http://www.hulenbend.net/test2.html ...
4
by: Mad Scientist Jr | last post by:
I have a textbox that i am adding to (in codebehind of ASP.NET) and need to ensure that the focus is scrolled to the bottom of the textbox each time the page refreshes, and then set focus to a 2nd...
0
by: Mad Scientist Jr | last post by:
I have a textbox that i am adding to (in codebehind of ASP.NET) and need to ensure that the focus is scrolled to the bottom of the textbox each time the page refreshes, and then set focus to a 2nd...
0
by: mjohnson0321 | last post by:
I am trying to incorporate a CSS drop-down menu into a site (suckerfish menu). The menu gets lost behind the content below it, but only on one of the drop downs (News). The error occurs on all of...
7
by: GTalbot | last post by:
Hello fellow authoring.stylesheets colleagues, Can someone please explain why the bottom margin of the last inflow block-level child in an overflowed parent should not have its margin reachable....
2
by: registry | last post by:
<%@Language="VBSCRIPT" CODEPAGE="1252"%> <html> <head> <title>Registry Network Hospital Detail</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script...
3
by: smokymtnman | last post by:
I have a drop down menu that has grown so long that I am afraid it will be hidden at the bottom of the page. I am using a ssi file for navigation. I was wondering if I can use the same code but...
0
by: buzzard724 | last post by:
Ul li drop down menu works in FF not quite in IE Thank you for looking at this. The page is generated dynamically by php, js and jquery. The drop down menu ul- reports-li - works fine in FF. In...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.