Tag:base class

  • Configure the global exception interceptor in springboot and return the self-determined HTTP error code to the front end


    Create interceptor class and annotate @ controlleradvice annotation @ControllerAdvice public class GlobalExceptionAdvice { //Handle unknown exception @ExceptionHandler(Exception.class) @ResponseBody @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) public UnifyResponse handleException(HttpServletRequest request, Exception e){ String method = request.getMethod(); String requestUrl = request.getRequestURI(); System.out.println(method); System.out.println(requestUrl); System.out.println(e); Unifyresponse unifyresponse = new unifyresponse (9999, “server exception”, requesturl + “” + method); return unifyResponse; } } public class […]

  • C + + learning records (6) — Inheritance and polymorphism of class models


    OOP features (inheritance) At this stage, we can further discuss the specific implementation of OOP in programming.Last time, we proposed the concept of class. In fact, the class corresponds to the class in OOPabstractThis concept. We extract the common points of things and abstract them into classes.This time,To improve code reusability, C + + proposes […]

  • 18. Design mode – observer mode


    Observer mode can be said to be a design mode very close to our life. Why do you say so? There is a philosophical saying that “everything is connected”. The original meaning is that there is no isolated thing in the world, but in fact, it can also be understood that the occurrence of any […]

  • Effective c# (2) -. Net resource management


    Understand and make good use of. Net resource management mechanism The. Net environment provides a garbage collector (GC) to help control managed memory, which makes developers do not have to worry about memory management problems such as memory leakage. Nevertheless, the garbage collector will perform better if developers can do the cleaning they should do […]

  • Effective c# (5) – exception handling


    Programs always make mistakes, because even if developers do it carefully, unexpected things will happen. Making the code stable in case of exceptions is a key skill that every c# programmer should master.. net framework design guidelines suggests that if the method cannot complete the operation requested by the caller, you can consider throwing an […]

  • Django 1.8 official document translation: 2-1-1 model syntax (first draft)


    Django document collaborative translation team is short of manpower. Interested friends can join us. It is completely public welfare. Communication group: 467338606 Website:http://python.usyiyi.cn/django/index.html Model A model is a simple, deterministic source of information about your data. It contains some necessary fields and behaviors for the data you store. Generally speaking, each model corresponds to a […]

  • Interview summary: Goose factory Linux background development interview written examination C + + knowledge points reference notes


    The article is continuously updated every week. Your “three links” are the greatest affirmation to me. WeChat can search the public for the first time to read the official account of “backend Technology School” (usually one to two updates earlier than blogs). The article was sorted out from Tencent’s notes of his written interview. When […]

  • Three characteristics and six principles of object oriented programming


    Three characteristics Encapsulation, inheritance, polymorphism Take the simple factory model as an example namespace DesignMode_01 { //Compute base class public class Operation { private double _numberA = 0; private double _numberB = 0; public double NumberA { get => _numberA; set => _numberA = value; } public double NumberB { get => _numberB; set => […]

  • C + + object oriented: C + + inheritance


    Inheritance is the most important concept in object-oriented programming. Inheritance allows us to define a class based on another class, which makes it easier to create and maintain an application. In this way, we can reuse code function and improve execution efficiency. When creating a class, you don’t need to rewrite new data members and […]

  • What are numbers in Python?


    Cat language: in Python, different types of numbers can do arithmetic operations directly without explicit type conversion. However, its “implicit type conversion” may be different from other languages, because numbers in Python are special objects derived from the same abstract base class. In the last articlearticleIn, we discussed the python number operation, and then I […]

  • Knowledge sharing: C + + interface (abstract class)


    Interfaces describe the behavior and function of a class without the need to complete a specific implementation of the class. C + + interface is implemented by using abstract classes, which are not confused with data abstraction. Data abstraction is a concept that separates implementation details from related data.     If at least one […]

  • Flutter DIO secondary packaging


    catalog: Diomanager: DIO helper classNwmethod: request method, get, post, etcNwapi: you all know thatEntityfactory: JSON transforms the auxiliary factory to tBaseentity < T >: data base class. The returned parameters are {“code”: 0, “message”: “,” data “: {}}Baselistentity < T >: data base class 2, the returned parameters are {“code”: 0, “message”: “,” data “: […]