✏️/Java

[Java] Method Naming Convention

dolmeng2 2022. 10. 22. 02:48

- 개인적으둜 κ°œλ°œμ„ μ§„ν–‰ν•˜λ©΄μ„œ DTO λ‹¨μ˜ λ©”μ„œλ“œ 이름을 지을 λ•Œ ofλ₯Ό 아무 생각 없이 μ‚¬μš©ν•˜κ³ λŠ” ν–ˆμ—ˆλŠ”λ°, Orcale 곡식 λ¬Έμ„œμ—μ„œ μžλ°”μ˜ λ©”μ„œλ“œ 넀이밍 μ»¨λ²€μ…˜μ— κ΄€ν•œ 글이 μžˆλŠ” κ±Έ ν™•μΈν•΄μ„œ... κ°„λ‹¨ν•˜κ²Œ μ •λ¦¬ν•΄λ†“κ³ μž ν•œλ‹€.

 

 

Method Naming Conventions (The Java™ Tutorials > Date Time > Date-Time Overview)

The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available. See Java Language Changes for a summary of updated

docs.oracle.com

 

- ν‘œμ—λŠ” μ΄λ ‡κ²Œ λ‚˜μ™€μžˆλŠ”λ°, λŒ€μΆ© ν•œκ΅­μ–΄λ‘œ ν’€μ–΄μ“°λ©΄

of static νŒ©ν† λ¦¬ λ©”μ„œλ“œμ—μ„œ input으둜 λ“€μ–΄μ˜¨ νŒŒλΌλ―Έν„°λ₯Ό λ³„λ„λ‘œ λ³€ν™˜ν•˜μ§€ μ•Šκ³ , μΈμŠ€ν„΄μŠ€λ₯Ό 생성할 λ•Œ μ‚¬μš©
from static Input으둜 λ“€μ–΄μ˜¨ νŒŒλΌλ―Έν„°λ₯Ό λ³€ν™˜ν•˜μ—¬ target class의 μΈμŠ€ν„΄μŠ€λ‘œ λ³€ν™˜ν•  λ•Œ μ‚¬μš©
parse static input으둜 λ“€μ–΄μ˜¨ λ¬Έμžμ—΄μ„ νŒŒμ‹±ν•˜μ—¬ λŒ€μƒ 클래슀의 μΈμŠ€ν„΄μŠ€λ₯Ό 생성할 λ•Œ μ‚¬μš©
format instance νŠΉμ •ν•œ 포맀터λ₯Ό ν™œμš©ν•˜μ—¬ temporal object의 값을 ν¬λ§·νŒ…ν•΄ λ¬Έμžμ—΄μ„ 생성 μ‹œ μ‚¬μš©
get instance λŒ€μƒ 객체의 일뢀λ₯Ό λ°˜ν™˜ν•  λ•Œ μ‚¬μš©
is instance λŒ€μƒ 객체의 μƒνƒœλ₯Ό μ§ˆμ˜ν•  λ•Œ μ‚¬μš©
with instance λŒ€μƒ 객체의 볡사본을 λ°˜ν™˜ν•˜λ©°, 이게 λΆˆλ³€ 객체둜 관리될 λ•Œ μ‚¬μš©
plus instance μ‹œκ°„μ— 따라 λŒ€μƒ 객체의 볡사본을 λ°˜ν™˜ν•  λ•Œ μ‚¬μš© (μ‹œκ°„ 증가)
minus instance μ‹œκ°„μ— 따라 λŒ€μƒ 객체의 볡사본을 λ°˜ν™˜ν•  λ•Œ μ‚¬μš© (μ‹œκ°„ κ°μ†Œ)
to instance λ‹€λ₯Έ νƒ€μž…μœΌλ‘œ λ³€ν™˜ν•  λ•Œ μ‚¬μš©
at instance λ‹€λ₯Έ 객체와 κ²°ν•©ν•  λ•Œ μ‚¬μš©

- 사싀상 많이 μ‚¬μš©ν•˜λŠ” 건 of, from μ •λ„μ—¬μ„œ μ•„λž˜ μ •λ„λ§Œ μ•Œμ•„λ‘λ©΄ 쒋을 것 κ°™λ‹€.

of : λ³€ν™˜ 없이 κ·ΈλŒ€λ‘œ μΈμŠ€ν„΄μŠ€ 생성 μ‹œ μ‚¬μš© 

from : λ³€ν™˜ν•˜μ—¬ νŠΉμ •ν•œ νƒ€μž…μ˜ μΈμŠ€ν„΄μŠ€ 생성 μ‹œ μ‚¬μš©