简体   繁体   中英

Use Settings File in Business Layer (BLL)

I have a settings file in my UI layer, and I need to use its values in my business layer. My UI and business layers are in separate assemblies.

I can't access the settings values in the business layer directly, so I currently pass them through the business layer constructor. I am considering making a class that contains all the settings file values and passing it through the business layer constructor.

Is this the best way to access these values, or is there another way?

I would put the settings in their own class. Keep that class in the business logic layer as that's where it should get used. Fetch the settings in the data access layer, called from the Business logic layer. You could use a separate class for UI settings that only concern the presentation of information.

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