추상 클래스 명명 규칙
추상 클래스의 이름에 접두사가있는 팀 코딩 표준이 있어야 Abstract
합니까? 예 :
public abstract class AbstractB implements B {}
예, 실제로 http://download.oracle.com/javase/6/docs/api/ 에서 표준 라이브러리의 javadocs를 보면 왼쪽 하단 프레임의 클래스 목록이 다음으로 시작하는 것을 알 수 있습니다. 질문에서 언급 한 명명 규칙을 사용하는 추상 클래스.
AbstractAction
AbstractAnnotationValueVisitor6
AbstractBorder
AbstractButton
AbstractCellEditor
AbstractCollection
AbstractColorChooserPanel
AbstractDocument
AbstractDocument.AttributeContext
AbstractDocument.Content
AbstractDocument.ElementEdit
AbstractElementVisitor6
AbstractExecutorService
AbstractInterruptibleChannel
AbstractLayoutCache
AbstractLayoutCache.NodeDimensions
AbstractList
AbstractListModel
AbstractMap
AbstractMap.SimpleEntry
AbstractMap.SimpleImmutableEntry
AbstractMarshallerImpl
AbstractMethodError
AbstractOwnableSynchronizer
AbstractPreferences
AbstractProcessor
AbstractQueue
AbstractQueuedLongSynchronizer
AbstractQueuedSynchronizer
AbstractScriptEngine
AbstractSelectableChannel
AbstractSelectionKey
AbstractSelector
AbstractSequentialList
AbstractSet
AbstractSpinnerModel
AbstractTableModel
AbstractTypeVisitor6
AbstractUndoableEdit
AbstractUnmarshallerImpl
AbstractWriter
그들 중 하나를 가져다가 첫 번째 것을 말하고 정의를 확인하십시오 AbstractAction
.. 그것은 실제로 Action
당신의 관습과 비슷한 것을 구현 합니다. : 그것은의 서브 클래스는 같은 이름이 지정됩니다 ClosedAction
, MaximizeAction
등
Generally any kind of standard is a good thing in a team setting. Otherwise team members might name classes in such a way that only they understand and then you could get a mix of people's different coding styles which leads to confusion.
For Readability it does sound like a good idea. When reading code you will be able to know right away what the class is. As long as everyone follows the standard it is good.
Modern IDEs will pop up descriptive text when you hover over an object. Prefixing is redundant in this case.
I won't say yay or nay in an answer, but whatever you choose, use a good static analysis tool to ensure it.
As with most questions of this type: "it depends". I like consistency and clarity, so if it works for you and your shop, great. However, if you have legacy Abstract classes, you would then want to go back and refactor them to the same naming convention.
참고URL : https://stackoverflow.com/questions/6861671/abstract-class-naming-convention
'Development Tip' 카테고리의 다른 글
Visual Studio에서 이전에 실행 된 몇 줄이 무엇인지 확인하기 위해 뒤로 물러 설 방법이 있습니까? (0) | 2020.12.04 |
---|---|
std :: function이 동등하지 않은 이유는 무엇입니까? (0) | 2020.12.04 |
LLDB 디버거에서 메서드를 호출하거나 코드를 실행하는 방법은 무엇입니까? (0) | 2020.12.04 |
.class : last-of-type이 작동하지 않는 이유는 무엇입니까? (0) | 2020.12.04 |
배치 파일의 문자열 비교 (0) | 2020.12.04 |