SSM Framework Issues and Java

Source: Internet
Author: User
Tags aop throw exception

What is the role of beanfactory?

Beanfactory is a container for configuring, creating, and managing beans, sometimes referred to as the bean context. The bean-to-bean dependency is also maintained by Beanfactory.

    • What are the two basic behaviors of beans in spring containers?

The bean defaults to Singleton.

If you do not want a singleton, the following configuration:

<bean id= "user" class= "..." singleton= "false"/>

Singleton is the configuration of this bean is a singleton, if not write, is the default value of True.

Annotations:

Spring Bean life cycle

The scope of the 1.Bean can be set through the scope property of the bean tag, and the scope of the bean includes:

By default scope= "Singleton", then the Bean is a singleton, and anyone getting the bean instance is the same instance;

< EM id= "__mcedel" > scope= "prototype", any instance is a new instance;

Scope= "Request", in a Web application, the scope of each instance is the request scope;

< EM id= "__mcedel" > scope= "session", in a Web application, each instance is scoped to the session scope;

< EM id= "__mcedel" > Note: By default, the bean instance is instantiated when it is initialized by the spring container, The default invocation of a parameterless constructor method. In other cases, the bean will be instantiated when the instance is fetched

< EM id= "__mcedel" > 2.bean can specify a method to execute after initialization by specifying a property Init-method, and a method to be executed when destroying by specifying a property Destroy-method.

< EM id= "__mcedel" > syntax: <bean .... destroy-method= " Method Name "Init-method=" that is called when destroying is "/>";

    • How does Ajax work?
    • AJAX is a technique for creating fast, Dynamic Web pages. AJAX enables Web pages to be updated asynchronously by exchanging small amounts of data in the background with the server. This means that you can update a part of a webpage without reloading the entire page. Traditional Web pages (without Ajax) must reload the entire Web page if you need to update the content.

Is the EE a technology or a platform or a framework?

The Java EE itself is a standard, a standard platform for the development of enterprise distributed applications.

The Java EE is also a framework, including JDBC, JNDI, RMI, JMS, EJB, JTA and other technologies.

What is AOP please Xiang

AOP divides a software system into two parts: core concerns and crosscutting concerns. The so-called core focus is the main process of business processing, that is to say, what this solution will do. The so-called crosscutting concerns, which are unrelated to the core business, tend to occur in many of the core concerns, and are similar everywhere, such as logs, transactions, permissions, etc.

Describe what an ORM is

The full name of the ORM is object-relational Mapping translated into Chinese is "object-relational mapping"

The main function of ORM components is to implement the persistence of entity domain objects and encapsulate the details of database access.

ORM is not a component in itself, it is a generic term for a component with a certain function, or it can be said to be a box frame Structure

Abstract class Summary:

1. Abstract classes can not be instantiated (beginners are prone to make mistakes), if instantiated, will error, compile cannot pass. Only non-abstract subclasses of abstract classes can create objects.
2. Abstract classes do not necessarily contain abstract methods, but classes with abstract methods must be abstract classes.
3. Abstract methods in abstract classes are only declarations, do not contain method bodies, that is, the concrete implementation of the method is the specific function of the method.
4. A constructor method, a class method (a static decorated method) cannot be declared as an abstract method.
5. Subclasses of an abstract class must give a concrete implementation of an abstract method in an abstract class, unless the subclass is also an abstract class.

Talk about memory allocation in Java?

Java divides memory into two types, called stack memory, which is called heap memory.
Some basic types of variables and object reference variables defined in the function are allocated in the stack memory of the function. When you define a variable in a block of code,
Java allocates memory space for this variable in the stack, and when the scope of the variable is exceeded, Java automatically frees up the allocated memory space for that variable, and the memory space can be used for other purposes immediately.
Heap memory is used to hold objects and arrays created by new. The memory allocated in the heap is managed by the Java Virtual Machine automatic garbage collector. After creating an array or object in the heap, you can also define a special variable in the stack.
The value of this variable is equal to the first address of the array or object in the heap memory, and this particular variable in the stack becomes the reference variable of the array or object.
You can then use the reference variable in the stack memory in your program to access the array or object in the heap, which is the equivalent of an alias, or codename, of an array or object.
A reference variable is a normal variable that is defined when memory is allocated in the stack, and the reference variable is released in the program run to the extraterritorial scope. and the array & object itself is allocated in the heap,
The heap memory occupied by the array and the object itself will not be freed, even if the program is running to a block of code that uses new to produce arrays and objects.
Arrays and objects become garbage when no reference variable points to it, can no longer be used, but still occupy memory and are freed by the garbage collector at a later indeterminate time.
This is also the main reason why the Java comparison occupies memory. But when writing a program, you can control it artificially.

What is the difference between throw and throws?
Throws is used to declare all exception information that a method may throw
A throw is a specific type of exception thrown.
Usually in a method (class) declaration through throws declaration method (class) may throw exception information, and in the method (class) through the throw declaration of a specific exception information.
Throws usually does not show the catch exception, the system can automatically throw all the caught exception information to the superior method;
The throw will require the user to catch the relevant exception, and then wrap it in the wrapper, and finally throw the exception after the package.

The difference between ArrayList and vectors, the difference between HashMap and Hashtable
A: ArrayList and vectors are mainly from two aspects.
I. Synchronization: vector is thread-safe, that is, synchronous, and ArrayList is a thread program is not secure, not synchronous
Two. Data growth: When growth is needed, vectors grow by default to the original, while ArrayList is half the original
HashMap and Hashtable are mainly from three aspects.
I. Historical reasons: Hashtable is based on the old dictionary class, HashMap is an implementation of the map interface introduced by Java 1.2
Two. Synchronization: Hashtable is thread-safe, that is, synchronous, and HashMap is a thread program is not secure, not synchronous
Three. Value: Only HashMap can let you use NULL as the key or value of an entry for a table

How does the garbage collection mechanism work?
In Java, the Java VM looks at every piece of memory allocated by new every once in a while to see if a valid reference to it exists, and if the reference does not exist,

The system automatically places the space in the free memory area. This process is called garbage collection.

Jdk,jvm,jre

JDK contains JRE and other Java tools

The JRE contains the JVM, which is the Java runtime environment, including the Java core class

A Java program is first compiled into class and then connected to the JRE by the JVM at run time to get the executable file, the executable file through the Java Virtual machine to tune the system platform underlying instructions

http://jnn.iteye.com/blog/83105

SSM Framework Issues and Java

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.