简体   繁体   中英

Should i really abstract everything

So I need to create a customer system and there aren't multiple types of customers.

Should I still create an interface or abstract class to inherit from?

No. You should only abstract what is needed to be abstracted. You can always come back later and refactor your code if there are new types of customer to be added.

Always keep your design as simple as needed to get the job done.

Don't add abstractions because they look good, you might never need them. Add abstractions because you need them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM