oop - What is high level modules and low level modules.? -


i know exact duplicate of below link.

what "high-level modules" , "low-level modules" (in context of dependency inversion principle)?

but after reading not understand is.

high level modules abstract classes , interfaces ? 

high level module interface / abstraction consumed directly presentation layer. low level on other hand bunch of small modules (subsystems) high level work. example below high level module. have excluded dependency constructor injection shorter sample.

public class orderservice : iorderservice {     public void insertorder(order ord)     {         if(ordervalidator.isvalidorder(ord)         {             orderrepository.insertnew(ord);             usernotification.notify(ord);         }     } } 

and 1 of low level module (the ordervalidator):

public class ordervalidator : iordervalidator {     public bool isvalidorder(order ord)     {         if(ord == null)              throw new nullargumentexception("order null");         else if(string.isnullorempty(ord.customerid))              throw new invalidargumentexception("customer not set");         else if(ord.details == null || !ord.details.any())             throw new invalidargumentexception("order detail empty");     } } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -