惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recorded Future
Recorded Future
Microsoft Security Blog
Microsoft Security Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
B
Blog RSS Feed
小众软件
小众软件
博客园 - 叶小钗
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 聂微东
博客园_首页
B
Blog
雷峰网
雷峰网
S
SegmentFault 最新的问题
N
Netflix TechBlog - Medium
D
Docker
博客园 - 司徒正美
博客园 - 【当耐特】
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
U
Unit 42
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
腾讯CDC
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
Jina AI
Jina AI
WordPress大学
WordPress大学
D
DataBreaches.Net
V
V2EX
V
Visual Studio Blog
Know Your Adversary
Know Your Adversary
P
Privacy & Cybersecurity Law Blog
F
Full Disclosure
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
The Hacker News
The Hacker News
Security Archives - TechRepublic
Security Archives - TechRepublic
IT之家
IT之家
P
Privacy International News Feed

博客园 - 笑笑江南

sss IBATIS 延迟加载 iBATIS一对多/多对多N+1问题解决方案 - 笑笑江南 - 博客园 [转]office outlook 2007 如何设置开机自动启动 代码整洁之道 eclipse 快捷键 9-15 企业数据更新 mysql 常用函数 利用myeclipse生成Hibernate Mapping文件【转】 配置eclipse下tomcat启动参数【转】 安装svneclipse .net 开发相关工具(包)的作用 basicform 与 store gridpanel中拖拽排序 struts2 file 标签产生的一个问题 使用 ajax 提交数据 applyTo ,render, contentel,el,applytomarkup 的区别 呕吐呕吐 tabpanel 添加 tab
类关系
笑笑江南 · 2010-04-09 · via 博客园 - 笑笑江南

Dependency between classes means that one class uses, or has knowledge of, another class. It is typically a transient relationship, meaning a dependent class briefly interacts with the target class but typically doesn't retain a relationship with it for any real length of time.

A dependency implies only that objects of a class can work together.
The dependency relationship is often used when you have a class that is providing a set of general-purpose utility functions, such as in Java's regular expression (java.util.regex ) and mathematics (java.math ) packages. Classes depend on the java.util.regex and java.math classes to use the utilities that those classes offer.

Associations are stronger than dependencies and typically indicate that one class retains a relationship to another class over an extended period of time. The lifelines of two objects linked by associations are probably not tied together (meaning one can be destroyed without necessarily destroying the other).
Association means that a class will actually contain a reference to an object, or objects, of the other class in the form of an attribute.

Aggregation is a stronger version of association. Unlike association, aggregation typically implies ownership and may imply a relationship between lifelines.

Composition is used to capture a whole-part relationship. The "part" piece of the relationship can be involved in only one composition relationship at any given time. The lifetime of instances involved in composition relationships is almost always linked; if the larger, owning instance is destroyed, it almost always destroys the part piece.