blogs's People
blogs's Issues
java 代理模式
java 注解
java 代理模式
代理模式的定义:为一个对象(实例)找一个或多个替身或占位符,通过操作这些替身或占位符,来对这个对象进行控制
代理模式用来创建代表对象,通过控制代表对象达到控制真实对象的目的,比如如果想对真实对象进行安全性的补充,可以不修改真实对象,创建一个安全代表对象,对这个安全代表对象无论怎么改都不会影响到真实对象的代码。
代表对象本质还是去调用真实对象,只是一些特有的东西全部写在代表对象里,代表对象对数据进行一系列处理后再调用真实对象。
几种代理控制访问的方式:
1.远程代理控制访问远程对象
2.虚拟代理控制访问创建开销大的资源
3.保护代理基于权限控制对资源的访问
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.