0

Can someone just show me an example of a code snippet that is meant for a framework (Spring or Guice) vs how it would be written in an ordinary form? It could be any framework for either C++ or Java

sephoro
  • 150
  • 10
  • Please submit a code example that is giving you trouble. Otherwise, you probably out to find a (good C++ book) [https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list] to curl up with for a few days/weeks. – Gardener Mar 07 '19 at 19:44
  • 1
    The difference (if I understand you correctly, which may very well not be the case since your question is quite unclear to me): framework code: code meant to be used as a foundation for you to build upon. Ordinary code: well, *anything*. It's not like one is written in a different language. It's just the *purpose* that's different. If you write some code and call it a "framework", well, then I guess it's a framework. There's nothing inherent *in* the code that *makes it* a framework. – Jesper Juhl Mar 07 '19 at 19:45
  • See Wikipedia: [Software framework](https://en.wikipedia.org/wiki/Software_framework) – Andreas Mar 07 '19 at 19:47

1 Answers1

1

The C++ language doesn't make that distinction. A "framework" is often a library that provides a more-or-less coherent set of types, objects, and functions for solving a particular class of problems. For example, a GUI framework manages a graphical user interface; a Unit Testing framework supports unit testing, etc.

When you build a library you use a librarian to combine various object files together into a library file. When you build an application using that library you link to the library; the linker pulls in the various parts of the library that your program uses.

Pete Becker
  • 74,985
  • 8
  • 76
  • 165