Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Explain and discuss in- depth and own words the 3 guidelines and why it's important when making a code project or assignment. Use at least
Explain and discuss in- depth and own words the 3 guidelines and why it's important when making a code project or assignment. Use at least one page for discussion for each guideline. It is OK to use code to help demonstrate your points. The code portion, if any, should not take up more than 1/3 of each guideline's discussion
1. Cohesion [] A class should describe a single entity, and all the class operations should logically fit together to support a coherent purpose. [] A single entity with many responsibilities can be broken into several classes to separate the responsibilities. 2. Consistency [] Follow standard Java programming style and naming conventions. Choose informative names for classes, data fields, and methods. A popular style is to place the data declaration before the constructor and place constructors before methods. . . [] Make the names consistent. It is not a good practice to choose different names for similar operations. [] In general, you should consistently provide a public no-arg constructor for constructing a default instance. If a class does not support a no-arg constructor, document the reason. If no constructors are defined explicitly, a public default no-arg constructor with an empty body is assumed. [] If you want to prevent users from creating an object for a class, you can declare a private constructor in the class, as is the case for the Math class.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started