Singleton instance per Spring IoC container. This is the default.
prototype
Scopes a single bean definition to any number of object instances. That means, every time, it requires to inject the bean or the getBean method is called. Continue reading
In Spring, we can easily define configuration value in a YAML file, and inject those configuration into a Java class.
Take the following the YAML configuration file as an example.
YAML
server:localhost# by default, spring split the string with commalistValues:a,b,c,d# if we want to split the string with customize character, we can use Spring ELlistValuesWithSpEL:a,b;c,d;e,f# we can inject the whole complexObject into another class, with annotation ConfigurationPropertiescomplexObject:port:90ssl:falselistValues:a,b,c,dlistValuesWithSpEL:a,b;c,d;e,f
RSQL is a query language for parametrized filtering of entries in RESTful APIs. It’s based on FIQL (Feed Item Query Language) – an URI-friendly syntax for expressing filters across the entries in an Atom Feed.
RSQL JPA translates RSQL query into org.springframework.data.jpa.domain.Specification or com.querydsl.core.types.Predicate and support entities association query.
It's easy to use Mock for a python method, staticmethod, classmethod, but for propery, it's not just to use Mock. Here are the example to mock a property of a class in python UT.
Database access object. A standard of J2EE pattern to access the database. It leverages PO to do database operations.
DAO
DTO
Data transfer object, used to transfer data between controll and client through HTTP or other ptotocol. PO may be not suitable to transfer directly to client, it may contains sensitive information. So, we need DTO to only transfer necessary data to client.
Controller, Service
BO
Business object, it leverages DAO, PO, VO(value object) to do business operations.
Service
View Object
View object are used to present a view to end users, it can be a DTO.
Controller, Client
Value Object
It's an object that may contains all or subset of a PO fields, and also can contain other fields. It's created by new operator, and it's not visible to Dao or database.
Service
PO
Persistent object, it maps to database object. Usually, entity objects are PO. Created and managed with database opereations.
If you are familar with C or Java, you must know that break is requird for a switch's case branch, if break is missed, then it will fall through to next case.
A Java platform thread is mapped to OS Kernel thread, as the resource is limited, we can't create as many as platform threads as we want.
Even Java provides executor pool, it also can't handle some cases. For example, if we want to create thoudsands of IO tasks, virtual threads is more suitable than platform threads.