当前位置:网站首页>Niuke Mianjing 02

Niuke Mianjing 02

2022-06-10 11:09:00 csx_ zzh

Briefly GDB Common debugging commands

(gdb)help: View command help , The specific command query is in gdb Input in help + command , Abbreviation h
(gdb)run: Restart running the file (run-text: Load text file ,run-bin: Loading binaries ), Abbreviation r
(gdb)start: Step by step , Run the program , Stop at the first execution statement
(gdb)list: View the original code (list-n, From n Line to start looking at the code .list+ Function name : View specific functions ), Abbreviation l

say ArrayList Implementation principle of

Array implementation 、 Default capacity is 10、 Every expansion 1.5 times

Introduce to you Java Serialization and deserialization in

serialize : It is to output and write the object into the file in the form of bytes through the stream . Correlation flow –ObjectOutputStream
Deserialization : Is to reconstruct the bytes in the file into objects . Correlation flow –ObjectInputStream
If both are operating on the same object , Use the same text address whenever possible . And try to 1 order 1 Reverse operation , Prevent errors .

What is? MVC

MVC It's a design pattern , In this mode, the software is divided into three layers , namely Model( Model )、View( View )、Controller( controller ).Model It's data ,View Represents the user interface ,Controller Represents the data processing logic , It is Model and View This two-story Bridge . The benefits of layering software are , You can reduce the coupling between objects , Easy to maintain code .

Model: An object model abstracted from the real world , It is the reaction of applied logic . It encapsulates data and operations on data , It is the place where data processing is actually carried out . stay MVC Of the three components of , The model has the most processing tasks . The data returned by the model is neutral , The model has nothing to do with the data format , Such a model can provide data for multiple views , Because the code applied to the model needs only to be written once, it can be reused by multiple views , So it reduces the repeatability of the code .

View: It is the interface between application and user , It is responsible for displaying the application to the user and the state of the model .MVC One of the benefits is that it can handle many different views for the application . There's no real processing in the view , It's just a way to output data and allow users to manipulate it .

Controller: The controller is responsible for the interaction between the view and the model , Controls the response to user input 、 Response mode and process . It's mainly responsible for two aspects of movement , One is to distribute the user's request to the corresponding model , The second is to reflect the changes of the model to the view in time .

The bonus answer is

Most typical MVC Namely jsp+servlet+javabean Pattern .

With JavaBean As a model , It can be used as a data model to encapsulate business data , It can also be used as a business logic model to include the business operations of the application .JSP As a view layer , Responsible for providing pages to display data for users , Provide the corresponding form for the user's request , And send a request to the controller at the appropriate time to request the model to be updated .Serlvet As controller , Used to receive requests submitted by users , Then get the data in the request , Convert it into the data model required by the business model , Then the business model is invoked to update the corresponding business methods. , At the same time, select the view to return according to the business execution result .

Of course , This method is not so popular now ,Spring MVC The framework has become MVC The most mainstream implementation of the pattern .Spring MVC The framework is based on Java Implementation of MVC Lightweight framework of framework pattern . The front controller is DispatcherServlet, The mapping processor is HandlerMapping Interface implementation class , The view parser is ViewResolver Interface implementation class , Page controller is Controller Interface implementation class .

Please tell me about UML What are the commonly used graphs in ?

UML A variety of graphical symbols are defined to describe some or all of the static and dynamic structures of the software system , Include : Use case diagram (use case diagram)、 Class diagram (class diagram)、 Sequence diagram (sequence diagram)、 Collaboration map (collaboration diagram)、 State diagram (statechart diagram)、 Activity diagrams (activity diagram)、 Component diagram (component diagram)、 Deployment diagram (deployment diagram) etc. . In these graphical symbols , There are three kinds of graphs that are most important , Namely : Use case diagram ( To capture requirements , Describe the function of the system , Through this diagram, we can quickly understand the functional modules and their relationships of the system )、 Class diagram ( Describe classes and the relationship between classes , Through this diagram, you can quickly understand the system )、 Sequence diagram ( Describe the interaction between objects and the execution order when performing specific tasks , Through this graph, we can understand the messages that the object can receive, that is, the services that the object can provide to the outside world ).

原网站

版权声明
本文为[csx_ zzh]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101054353354.html