473,839 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

top down vs. bottom up

2 New Member
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 16005
RedSon
5,000 Recognized Expert Expert
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 Recognized Expert Moderator Expert
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 New Member
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
10739
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | | | | | | | | left | center | right | | | | | | | | |
5
8786
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 system on top and the main text area. The presentation is about to be put on the web, so I'd like to add a footer on each page with the presentation name and a link back to the main site.
13
42360
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 I was looking for a style property like float:bottom but I guess there isn't one. I don't want to use any hard positional values like left: and top: Any help is appreciated.
4
7228
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 textbox (which the user types input into). I have tried a couple functions I found posted online but they don't work (see below) The closest I got was using the scrolldown method:
0
2736
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 textbox (which the user types input into). I have tried a couple functions I found posted online but they don't work (see below) The closest I got was using the scrolldown method:
0
3151
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 the browsers I have tested it on (IE6, IE7, Firefox, Opera and Safari). It is probably something simple, but I can't find it! Here is the CSS (using external style sheets): style-temp.css (Main style sheet for the site): * { font-family:...
7
3451
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. I read and re-read carefully the CSS 2.1 spec and I just can not see why. Related webpages: http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/MarginBottomChildNotRendered.html
2
1635
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 language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized
3
2063
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 break it into two columns. The site is: http://www.fabserv.com/ The code for navigation.ssi is pasted below:
0
2206
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 IE7 the menu displays and if I am very very careful with how I move the mouse I can sometimes manage to catch the submenu - particularly the first time the page is displayed. Usually the menu disappears before I can mouse over it. I guess this is...
0
9854
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9696
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10903
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10584
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10290
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7827
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7015
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5681
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3131
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.