当前位置:网站首页>Usage of ieda refactor
Usage of ieda refactor
2022-07-02 19:20:00 【thoughtCodes】
IEDA refactor Usage of
- Catalog
- summary
- Design thinking
- Analysis of implementation ideas
- 1.Refacot this
- 2.rename
- 3.rename file
- 4.change sinnature
- 5.Edit pro value
- 5.Type m
- 5.make static
- 6.convert to instance method
- 7.move class/member
- 8.copy class
- 9.safe delete
- 6.Extract
- inline super class
- Invert bolean
- find and repalce duliate:
- pull up member:
- pull down member:
- user inteface:
- inherit from replace
- remove middlman
- wrap method return value
- encapsulate Fields:
- replace temp with query
- replace constrct with factory
- replace constructor with build
- genirity
- migrate
- interliatelize
- migrate to anroidRx
- Sequence and method of use
- Expand to achieve
- Performance parameter test :
- References and recommended readings
Survive by day and develop by night.
talk is cheap, show me the code,make a better result.
Catalog

summary
I've always wanted to write this usage , I used it before , Only part of it is used , Now outline , When we write the corresponding code according to the business requirements , This is very important .
demand :
Design thinking
Analysis of implementation ideas
1.Refacot this
Select object , Right click to pop up the suggestion list , Select refactoring .
2.rename
This is simpler , Use naming conventions , Rename it .
3.rename file
Rename the currently selected file
4.change sinnature
Usually it's changing the method , Change method parameters .
5.Edit pro value
Change the attribute value , The directory object does not , May be pro Document has
5.Type m
Type related
5.make static
Action object , Directory does not , Method objects have , It should be to turn the method into static Of .
6.convert to instance method
Turn the method into static Of , and 5 What's the difference ?
7.move class/member
Mobile class directory structure
8.copy class
Will file copy To the specified directory , Local directory failed .
9.safe delete
This is simpler , Safe deletion , File to be deleted file does not exist .
6.Extract
variable
Failed to select file at present , The selected expression should be :
The extraction expression is constant :
constant

Filed
Select variable , Property name failed , Similarly, you choose an expression :
But notice this IEDA Logic is not automatically drawn in , Is to treat the expression as a member variable .
paraeter
Failed to select a single variable name or function list . What should be chosen is the expression :
Choose the former :
After refactoring :
however IEDA There is no corresponding project extraction in logic .
object
Failed to select a single variable name or function list .
method:

Select the code line in the specific method , Extraction method :
Type parameter
Invalid selection method list .
Method object

Turn the calling method into an internal class and an anonymous class :
delegate

Usually it is to generate a new class , As a delegate . Called by the delegate object .
interface:

result :
super class
First choose :
result :
Will extract int Attribute and add corresponding extends class :
inline super class
Select parent class : After analysis and quotation :
result :
Invert bolean
I don't know yet
find and repalce duliate:

pull up member:
pull down member:
Select the corresponding parent class , extract
user inteface:
Choose the method to use , Analyze , Interfaces can be used instead of
inherit from replace

Generate a delegate class , An interface is implemented internally .
remove middlman
The service class has completely become “ A middleman ”, At this point, you should let the client call the entrusted class directly .
wrap method return value
Encapsulation method
encapsulate Fields:

replace temp with query
Replace temporary results with queries
replace constrct with factory
Replace the construction method with the factory method ,
Select the method line : 
replace constructor with build
use builder Pattern construction method :
genirity
java The generics in , This information is scarce
migrate
transfer , Generally, it provides javaex,junit,swing Migration options :
interliatelize
online
migrate to anroidRx
Migrate to the corresponding androidRx:
Starting from the basic objects, there are probably so many , The menus that appear for different objects are not the same .
Sequence and method of use
From the perspective of granularity , look down :
Mainly
1.varibale,constant,filed Wait for the operation
2.function Internal level , Mainly extracting parameters , Object etc. .
3. Choosing multiple lines is method, or method object ( As an anonymous class , Internal class processing )
In fact, it is also different from the extraction menu .
Then it's based on class File level refactoring :
For a single class :
1. Delete , Move , Delete etc.
2. A higher level : Rename, etc .
This part can have operating system management , It only provides another editing entry .
For many categories : From a design point of view : Usually 3 individual :
delagate,interface,superclass,
The first objects to choose are extends,impl Keywords, etc , This part can be realized
For a mature project , Actual letter extends It seems to use more .
For its relationship expansion .
Then there are some pattern Has applied best practices .
Such as builder,factorypattern. Will generate a builder File and call file .
Then there is class lib Level ,
does jar transfer ,class Generic :
That's right Java Development is basically enough ,
If there is, it is the file conversion between systems, such as :
Transfer to androidX file .
So far, the analysis is finished .
Expand to achieve
- Entry level implementation :
- Partial source code implementation .
- The source code to achieve
Theory provides the basis . Generally optimized to pattern It's about the floor .
Performance parameter test :
nothing
References and recommended readings
Welcome to , Dear brother , If it helps you , A little praise and a little attention !~
边栏推荐
- Mysql高级篇学习总结7:Mysql数据结构-Hash索引、AVL树、B树、B+树的对比
- When converting from list to map, if a certain attribute may cause key duplication and exceptions, you can set the way to deal with this duplication
- MySQL advanced learning summary 8: overview of InnoDB data storage structure page, internal structure of page, row format
- QT中的QPropertyAnimation使用和toast案列
- 从list转化成map的时候,如果根据某一属性可能会导致key重复而异常,可以设置处理这种重复的方式
- Mysql高级篇学习总结6:索引的概念及理解、B+树产生过程详解、MyISAM与InnoDB的对比
- 守望先锋世界观架构 ——(一款好的游戏是怎么来的)
- 中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖
- yolov3 训练自己的数据集之生成train.txt
- 高级性能测试系列《24. 通过jdbc执行sql脚本》
猜你喜欢

Develop fixed asset management system, what voice is used to develop fixed asset management system

yolov3 训练自己的数据集之生成train.txt

Processing strategy of message queue message loss and repeated message sending

Tutoriel (5.0) 10. Dépannage * fortiedr * fortinet Network Security expert NSE 5

Introduction to the paper | application of machine learning in database cardinality estimation

Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径

【JVM调优实战100例】03——JVM堆调优四例

中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖

教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 网络安全专家 NSE 5
![[100 cases of JVM tuning practice] 03 -- four cases of JVM heap tuning](/img/54/8a18cd30e6186528599c0556b1ee3b.png)
[100 cases of JVM tuning practice] 03 -- four cases of JVM heap tuning
随机推荐
Mysql高级篇学习总结7:Mysql数据结构-Hash索引、AVL树、B树、B+树的对比
R language ggplot2 visual Facet: gganimate package is based on Transition_ Time function to create dynamic scatter animation (GIF)
R语言ggplot2可视化分面图(facet):gganimate包基于transition_time函数创建动态散点图动画(gif)
Page title component
思维意识转变是施工企业数字化转型成败的关键
Juypter notebook modify the default open folder and default browser
学习八股文的知识点~~1
【JVM调优实战100例】03——JVM堆调优四例
Digital scroll strip animation
End-to-End Object Detection with Transformers(DETR)论文阅读与理解
潇洒郎:彻底解决Markdown图片问题——无需上传图片——无需网络——转发给他人图片无缺失
Why should we build an enterprise fixed asset management system and how can enterprises strengthen fixed asset management
QT中的QPropertyAnimation使用和toast案列
mybatiesHelperPro工具必须的可以生成到对应项目文件夹下
ORA-01455: converting column overflows integer datatype
C的内存管理
使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
ORA-01455: converting column overflows integer datatype
R language dplyr package Na_ The if function converts the control in the vector value into the missing value Na, and converts the specified content into the missing value Na according to the mapping r
Learning summary of MySQL advanced 6: concept and understanding of index, detailed explanation of b+ tree generation process, comparison between MyISAM and InnoDB