I have an app where every object is checked based on various types of business rules. For this, i used multiple nested if-else statement which was done in one class. I am not happy with this situation because it became hard to manage.
I tried to add some design pattern such as chain of responsibility and specification but i still used if-else statement while applying these. I am stuck and i don't know which way to go. Here is pseudocode about business logic;
if name not in nameList
Obj newObj = getObjByName(obj.name)
if newObj = null
error()
else
Status newStatus = getStatusObj(obj.name, obj.status)
if newStatus = sold
success()
else if not newObj.type = obj.type
error()
else
Transport trans = getTransByType(obj.type)
if not trans = null
success()
else
if not newObj.count < 10
success()
else
error()
else
error()