Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS304 Object Oriented Programming GDB Solution January 2012
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
GDB will remain open for two consecutive working days. For this you have choice to post your comments from 23rd January to 24th January.
Topic is as follows:
“As the role of Template in programming is vital. Let’s suppose you are an Application development Analyst. You are given a task to highlight the value of using Templates in developing the Architecture for a large scale project.
Do you think that usage of Templates in given requirement is useful? Justify your answer with maximum five major points

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply
#2
CS304 GDB Idea Solution 2012

CS304 GDB Idea Solution 2012
Some uses of templates, such as the max() function, were previously filled by function-like preprocessor macros(a legacy of the C programming language). For example, here is a possible max() macro:

#define max(a,b) ((a) < (b) ? (b) : (a))
Both macros and templates are expanded at compile time. Macros are always expanded inline; templates can also be expanded as inline functions when the compiler deems it appropriate. Thus both function-like macros and function templates have no run-time overhead.
However, templates are generally considered an improvement over macros for these purposes. Templates are type-safe. Templates avoid some of the common errors found in code that makes heavy use of function-like macros. Such as evaluating parameters with side effects twice. Perhaps most importantly, templates were designed to be applicable to much larger problems than macros.
There are three primary drawbacks to the use of templates: compiler support, poor error messages, and code bloat. Many compilers historically have poor support for templates, thus the use of templates can make code somewhat less portable. Support may also be poor when a C++ compiler is being used with a linker which is not C++-aware, or when attempting to use templates across shared library boundaries. Most modern compilers however now have fairly robust and standard template support, and the new C++ standard, C++0x, is expected to further address these issues.
Almost all compilers produce confusing, long, or sometimes unhelpful error messages when errors are detected in code that uses templates. This can make templates difficult to develop.
Finally, the use of templates requires the compiler to generate a separate instance of the templated class or function for every permutation of type parameters used with it. (This is necessary because types in C++ are not all the same size, and the sizes of data fields are important to how classes work.) So the indiscriminate use of templates can lead to code bloat, resulting in excessively large executables. However, judicious use of template specialization can dramatically reduce such code bloat in some cases. The extra instantiations generated by templates can also cause debuggers to have difficulty working gracefully with templates. For example, setting a debug breakpoint within a template from a source file may either miss setting the breakpoint in the actual instantiation desired or may set a breakpoint in every place the template is instantiated.
Also, because the compiler needs to perform macro-like expansions of templates and generate different instances of them at compile time, the implementation source code for the templated class or function must be available (e.g. included in a header) to the code using it. Templated classes or functions, including much of the Standard Template Library (STL), cannot be compiled. (This is in contrast to non-templated code, which may be compiled to binary, providing only a declarations header file for code using it.) This may be a disadvantage by exposing the implementing code, which removes some abstractions, and could restrict its use in closed-source projects.



0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  HRM628 VU Current GDB No. 1 Spring April 2012 Solution required Vuhelper 1 3,684 07-22-2020, 08:06 PM
Last Post: Johnnieaunders
  MGT611 - Business & Labor Law GDB Closing Dat Tuesday, January 26, 2016 Vuhelper 0 1,596 01-23-2016, 06:22 PM
Last Post: Vuhelper
  MGT501 Human Resource Management GDB No. 2 Solution 23rd January 2016 Vuhelper 0 1,822 01-23-2016, 06:07 PM
Last Post: Vuhelper
  ECO401 Economics GDB no.1 Closing Date: January 28, 2016 Vuhelper 0 1,550 01-23-2016, 05:07 PM
Last Post: Vuhelper
  ORGANIZATIONAL DEVELOPMENT (MGMT628) GDB No 2 . 26th January 2016 Vuhelper 0 5,351 01-23-2016, 03:58 PM
Last Post: Vuhelper
  MTH302 Business Mathematics & Statistics GDB Solution 23rd January 2016 Vuhelper 0 1,689 01-23-2016, 03:39 PM
Last Post: Vuhelper
  STA630 Research Method GDB 2 solution 23rd January 2016 Vuhelper 0 1,994 01-23-2016, 03:15 PM
Last Post: Vuhelper
  MGT211 Introduction To Business GDB No 1 Solution Ideas Fall 2014 Vuhelper 0 1,672 12-04-2014, 03:20 PM
Last Post: Vuhelper
  MGT101 Financial Accounting GDB Solution and Discussion December 2014 Vuhelper 0 2,864 12-03-2014, 09:05 PM
Last Post: Vuhelper
  MGT201 Financial Management GDB No. 01 Solution Fall 2014 Last date is 4th Dec 2014 Vuhelper 0 2,474 12-03-2014, 03:58 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support