Software Engineering Training Day summary overview of java-based framework and review

Training summary (a)

1 , the training content:

The first day of the main content of the training are:

(1) Review java based, such as java classes, objects, collections, arrays. After the teacher finished also gives us some time to do some examples corresponding to consolidate our java programming capabilities.

(2) to explain the code specification, the teacher explained to us how to do it in the company code specifications, what kind of comment symbols to use in what position, what to write footnotes.

(3) down to some companies used to the web development framework, such as the SSM , SSH , springboot and so on. The teacher also told us now jdbc way link to the database in the enterprise has become obsolete, he has been replaced by frame.

(4) referred to the maven development projects, and in maven some of the effects of the annotation item, and a maven complete item data transfer process the order.

2, learning impression

In the course of the lecture, I learned a lot. A holiday did not write java code I feel a lot of things are forgotten, the words written code or but the speed has been a lot slower with time to today, there are half a day can be found online for me to go over java basic feeling is still very It was necessary. in

In the review java process, I also found some of my questions, I am very familiar with the operation of the database, find and copy and paste the code is also very familiar with, but once on a specific question asked, and especially the collection queue when issues, a lot of things will not ever, such as List , ArrayList , HashMap , TreeMap when the distinction between and under what circumstances should use what type of queue theory obviously felt inadequate knowledge. This is also reflected flaws in addition to our software engineering students, the operation was okay but extremely inadequate theory of. Rest and time to stay in the job and I went to see these relevant theoretical knowledge, to complement their knowledge.

Secondly stay java when class work I also found a problem, the teacher gave us written demand in some places we do not understand, when the teacher said set of scalable and fixed-length collection I found myself for a set of concepts and basic properties He has a great understanding of vulnerability.

The teacher and we say jdbc has been abandoned, when the now commonly used frameworks, explained to us some knowledge of the frame, but light frame data transfer process of the page jump to get my head is very big, due not previously had contact, resulting in their thinking is still stuck in jdbc , and jsp + servlet on.

Teacher before the end of the afternoon talking about the maven role workflow projects as well as some comments. Before we in the process of working class and the lower class is not used maven project. In the cup game development software, I have used maven + springboot worked on a simple micro-site service, Maven gave me the impression that one is easy because he did not own to download the pack, just in xml write the package file name, version will go to their own package repository to download, and secondly, when his module is particularly clear, Maven can create model projects for each model is a separate project, model can also be added model , then a different model use frames to link together to achieve a common operational project requirements.

Maven convenience also led to his entry is relatively difficult, maven structure between the modules demanding, and leaving big head when maven used @ + comments in lieu of a lot of code, and get to know different comments It corresponds to what has become a big head thing, the teacher of the course, some comments he did not say that we will use to tell on the line.

The first day talking about something relatively small, mostly retrospective overview of some previous knowledge and new knowledge, learning difficulty is not great.

Annex: into jav A difference between the range and the use of collections

ArrayList  implement the List interface, with constantly adding elements to the ArrayList, its capacity to grow automatically 

Vector vector but I do not like this class 

HashMap implements the Map interface - can be said that memory is a HashMap  the HashTable to implement a hash table , hash table that maps keys to values 

Set a container does not contain duplicate elements 

HashMap, HashTable are "Key-Value of" form

Vector and ArrayList difference

 Vector Vector and ArrayList and ArrayList very similar in use, can be used to set a variable number represents a collection of application objects, and may be accessed randomly element therein.

 Vector methods are synchronized ( Synchronized ), are thread-safe 's (thread-safe), and ArrayList methods are not, since the synchronization is bound to affect the performance of the thread, therefore, better than the performance of ArrayList Vector.

 When the ArrayList or Vector element beyond its original size, Vector will double its capacity, whereas only 50% of ArrayList size, so, there ArrayList help save memory space.

 

The difference between Hashtable and HashMap

 Hashtable and HashMap Vector thereof and ArrayList more similar performance, such as the method is synchronous Hashtable, rather than the HashMap.

 

The difference between ArrayList and LinkedList

For processing a data item , Java provides two classes ArrayList and LinkedList, ArrayList internal implementation is based on the internal array Object [], so Conceptually, it is more like an array, but LinkedList internal implementation is based on a set of connection recording, so that it is more like a linked list structure, therefore, they are very different in performance.

From the above analysis shows, the data is inserted at the front or intermediate ArrayList, you have all the data after the respective subsequent shift, this will inevitably take much time, so that when you are added after the operation of a data when the data is not in front of or in the middle, and the need to randomly access one of the elements, use ArrayList will provide better performance

While accessing an element in the list, it is necessary to begin to find a an element from one end of the chain along the connection direction, until you find the required elements, so when you are operating a column of data in front of or intermediate add or delete data, and wherein the elements in the order of access, you should use the LinkedList.

If the programming, 1,2 alternating both cases, then, you may consider using a common interface such as List, without concern for the specific implementation, in specific circumstances, its performance is guaranteed by a specific implementation.

Configuring the initial size of the collection classes

In the Java Collections Framework size of most of the class is to be with the increase in the number of elements and the corresponding increase, we do not seem to care about its initial size, but if we consider the kind of performance problems, be sure to consider the best possible to set up the initial size collection of objects, which will greatly improve the performance of the code.

For example, Hashtable default initial size of 101, load factor of 0.75, that is, if the number of elements which are over 75, it must reorganize and increase the size of the elements, so if you know that creating a new Hashtable object when you know the exact number of elements, such as 110, then it should be set to the initial size of 110 / 0.75 = 148, so you can avoid re-organization and increase the memory size.

 

@font-face { font-family: "Times New Roman"; }@font-face { font-family: "宋体"; }p.MsoNormal { margin: 0pt 0pt 0.0001pt; text-align: justify; font-family: "Times New Roman"; font-size: 10.5pt; }h3 { margin-top: 13pt; margin-bottom: 13pt; break-after: avoid; text-align: justify; line-height: 172%; font-family: "Times New Roman"; font-weight: bold; font-size: 16pt; }p.pre { margin: 0pt 0pt 0.0001pt; text-align: left; font-family: 宋体; font-size: 12pt; }span.msoIns { text-decoration: underline; color: blue; }span.msoDel { text-decoration: line-through; color: red; }div.Section0 { }

Guess you like

Origin www.cnblogs.com/837634902why/p/11441419.html