The difference between framework code and ordinary code [duplicate] - java

This question already has answers here:
What is a software framework? [closed]
(12 answers)
Closed 3 years ago.
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

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.

Related

Using Python Libraries or Codes in My Java Application [duplicate]

This question already has answers here:
Calling Python in Java?
(12 answers)
Closed 3 years ago.
I'm trying to build an OCR desktop application using Java and, to do this, I have to use libraries and functions that were created using the Python programming language, so I want to figure out: how can I use those libraries inside my Java application?
I have already seen Jython, but it is only useful for cases when you want to run Java code in Python; what I want is the other way around (using Python code in Java applications).
I have worked in projects where Python was used for ML (machine learning) tasks and everything else was written in Java.
We separated the execution environments entirely. Instead of mixing Python and Java in some esoteric way, you create independent services (one for Python, one for Java), and then handle inter-process communication via HTTP or messaging or some other mechanism. "Mircoservices" if you will.

Tool to create a diagrammatic representation of Java code / Get diagrams from code / Convert code to diagrams? [duplicate]

This question already has answers here:
Generate UML Class Diagram from Java Project [closed]
(4 answers)
Closed 9 years ago.
I want a tool which will see my java code or eclipse java project and convert it into diagrams which show relations and dependencies between classes and methods. Such a tool would greatly reduce the need to explain my code to others. It will make the relevant diagrams/pictures which are much easier to understand than only comments and java
docs.
Are there any reliable tools for such purposes ? I prefer free/open source tools. But, anything is okay as long as its accepted by the industry.
EDIT
I need all possible diagrams that one can think of - UML, Sequence, State, Interaction, Show which method calls which, etc. Its not a problem if each functionality is provided by a different tool. I can use multiple tools to generate different types of diagrams.
I think what you're looking for are class diagrams. If you don't know what UML is, you definitely need to take a look at it.
The question of generating class diagram with Eclipse has been extensively covered on SO, here are good pointers for Eclipse plugins.

Java Collections: Framework Or a library? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What is the difference between a framework and a library?
Java documentation says The collections framework
Why is java collections called a framework and not a library?
Now I am more confused about what I can expect from a framework as to a library..
The following characteristics differentiate Frameworks from libraries:
inversion of control - In a framework, unlike in libraries or normal user applications, the overall program's flow of control is not dictated by the caller, but by the framework.
default behavior - A framework has a default behavior. This default behavior must actually be some useful behavior and not a series of no-ops.
extensibility - A framework can be extended by the user usually by selective overriding or specialized by user code providing specific functionality.
non-modifiable framework code - The framework code, in general, is not allowed to be modified. Users can extend the framework, but not modify its code.
Basically a framework is a type of a library whose behavior cannot be changed. For instance, you can extend class ArrayList or HashMap in java, but you cannot change the behavior of those classes.

Could someone briefly differentiate a java library, a class, and a package [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm documenting my project which is a really simple Android application and I'm getting rather confused about the three.
Is what you import on Java the library? Is an API a library? If so, does that mean that Android is a library?
library : A collection of one or more packages will be called library.
package : A group of classes will contribute a package.
class : A compiled java which accomplish an atomic functionality of its own. A class is a construct that is used to create instances of itself
In java, you could either import a package or class itself. Yes, API could be called library using which we could built our own system/application. Android is a platform and not library. But android SDK could be called library instead which has API for talking to device.
A Class is the code construct that allows to create instances of itself or perform operations with the methods it includes. It's the basic unit of your programm.
A package if a collection of Classes that interact and offer some special functionality/help to accomplish a specific task.
A Library is a compound of Classes and Documentation that help in the development of software, often including several packages.
A library is a software that contains implementations of any kind of thing software can do '.dll' files in windows, '.jar' files in java. Libraries usually provide one or more APIs (Application Programming Interface), that allow you to use the application. To an API belong the public Classes and Interfaces in the Library (or the functions in C).
Android is an operating system. It provides libraries. These provide APIs.
EDIT: forgot packages:
packages are java's way of grouping classes and interfaces.
Another EDIT: classes are part of Object Oriented Languages. They define what Object's have (properties) and do (methods).
.class files are compiled java code.
class: A byte-code file produced by compiling the .java file using javac (Java compiler).Further read by JIT to convert it into runtime machine level executable code.
package: Collection of classes, In java mainly all the packages are according to their functionality.
library: Consider its a a collection of packages, documentation etc.

Can i access c++ or Java functions inside python [duplicate]

This question already has answers here:
Calling C/C++ from Python? [closed]
(12 answers)
Closed 11 months ago.
I am mainly using python for extensive algorithms operations. Now i have my webiste in Django.
I few libraries in c++ and few in Java which i don't have in python. Or you can say that i already have some c++ , Java files in which some algorithm is coded.
can i call those function or do some calculation in my djnago sites using those c++ or java files
For C++, certainly. Either write a module that wraps the library, or use something like ctypes or SWIG.
For Java, you'd be best to move to Jython (and correspondingly use django-jython).
Note that using both C++ and Java from Python is not trivial.
I've used Boost.Python to some degree of success for accessing C++ libraries within Python/Django.
You could check the http://www.scipy.org/Weave weave package for C/C++. I didn't use it myself, but I know it exists

Categories

Resources