Interview Question Answers - RealWorld-Yuchen-Yang/Notes GitHub Wiki

Java in General

  1. Java Bean

Spring

  1. Spring AOP Definition
    1.1 in AOP, the unit of modularity is aspect.
    Aspects enable the modularization of concerns such as transaction management that cut across multiple types and objects.
    Transaction is a good example of a crosscutting concern in enterprise Java applications.
    1.2 Join Point: a point during the execution of a program, such as the execution of a method or the handling of an exception.
    In Spring AOP, a join point always represents a method execution.
    1.3 Advice: action taken by an aspect at a particular join point.
    different types of advice include "around", "before", and "after" advice.
    1.4 Pointcut: a predicate matches join points.
    Advice is associated with a pointcut expression and runs at any join point matched by the pointcut
    The concept of join points are matched by point cut expressions in central to AOP,
    and Spring uses AspectJ pointcut expression language by default
    1.5 Introduction: declaring additional methods or fields on behalf of a type. Spring AOP allows you to introduce new interfaces to any advised object.
    1.6 Target Object: object bing advised by one or more aspects. it is implemented by using runtime proxy.
    1.7 AOP proxy: an object created by the AOP framework in order to implement the aspect contracts.
    In Spring Framework, an AOP proxy will be a JDK dynamic proxy or a CGLIB proxy.
    1.8 Weaving: linking aspects with other application types or objects to create an advised object.
    This can be done at compile time, load time, or at runtime.

  2. Are IOC and DI different?
    Spring helps in creating loosely coupled application because of Dependency Injection
    In spring objects define their associations and do not worry about how to get those dependencies now it is the responsibility of Spring to provide the required dependency for creating objects
    2.1 Inversion of Control (IOC) and Dependency Injection (DI) are used interchangeably.
    IOC is achieved through DI.
    DI is the process of providing the dependencies and IOC is the end result of DI
    Note: DI is not the only way to achieve IOC
    2.2 By DI, the responsibility of creating objects is shifted from our application code to Spring container
    hence the phenomenon is called IOC
    2.3 Dependency Injection can be done by setter injection, constructor injection

Database

  1. 分库存表, 并发

Cloud Computing

Service Model

Software Architecture And System Design

SOA (Service-Oriented Architecture)

  • It is a style of software design where services are provided to the other components by application components, through a communication protocol over a network.
  • One can implement SOA using any service-based technology, such as Jini, CORBA or REST
  • Architecture can operate independently of specific technologies and can therefore be implemented using a wide range of technologies, including
    • Messaging, e.g. with ActiveMQ, JMS, RabbitMQ
    • RESTful HTTP, with Representational state transfer (REST) constituting its own constrains-based architectural style.
⚠️ **GitHub.com Fallback** ⚠️