Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I make interfaces for my entities?

Is it normal/recommended to make interfaces for the entities in an application? If it is should getter/setters be declared in the interface or only business methods?

like image 538
LuckyLuke Avatar asked Oct 18 '25 14:10

LuckyLuke


1 Answers

Interface are for business logic, It's declare the behavior or functionality of your module. POJO's are just objects that contains data and not suppose to do any logic- so not.

like image 157
shem Avatar answered Oct 21 '25 02:10

shem