[自学日志] Structure Analysis 结构分析与设计

知识点:


Entity: list of things you need to notice down

Attribute: details/specific 

for example:

Entity (Class): Person

Attribute: id, name. age, contact number, etc. 

Method list: getID(), getAge()

注意⚠️:取名逻辑应该跟sourcecode相同,思维方式也应该按照programmer的思维来思考

结构分析与设计中,组合(Composition)聚合(Aggregation)面向对象建模中的两个关键概念,它们用于定义系统中不同组件之间的关系。这些概念在统一建模语言(UML)和系统架构中尤为重要。

特性组合(Composition)聚合(Aggregation)
所有权强(父对象控制子对象)弱(父对象不控制子对象)
存在依赖子对象依赖于父对象子对象可独立存在
UML符号实心菱形(◆)空心菱形(◇)
示例建筑物中的房间城市中的建筑物

Analysis phrase 具体步骤

1. Indicate Association  定义关系

比如一个人会有一个地址,那么:

class Person:
    def __init__(self, address):
        self.address = 

2. Analyze Multiplicity  定义数量

example:

Each customer has one or more account

Each account must belong to one or more person 

注意⚠️: 虽然和ER-diagram很相似,domain-class diagram 决定的是怎么编程,怎么转变为software,但ER-diagram定义的是数据库。

        - 在定义关系的时候,如果混淆,会容易把foreign key等概念带进来

Considerations 💭:在设计的时候,需要考虑未来的可能性,因为clients might have different needs in the future, so it is possible that you have to redesign it again.

Planning phase:

Goal:  establish the scope of the system

Tool: role map

之后想到更多再继续补充,如果有错误欢迎指正~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值