Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [business-logic]

The tag has no usage guidance.

4
votes
2answers
212 views

How to keep track of growing catalog of business rules?

Building my last application, everbody started to lose control over the increasing complexity of business rules, which would be added every week - most of all the app owners themselves. In the end, we ...
2
votes
3answers
166 views

What defines a business rule, as opposed to application or presentation logic?

The way I explain it to myself is that a business rule is a requirement for a domain concept of an application. One of the core tasks of my current app is to send notifications. Therefore I have a ...
2
votes
3answers
144 views

Business Logic Entities and Data Access Layer Entities

I am thinking on how to structure a project. I wonder if it is a good practice to use different entity classes between the BL and DAL in order to decouple these layers. I have worked on projects ...
1
vote
4answers
105 views

Rules engine suggestion for hard coded if-then-else

Reposting question as Previous post on same Topic was not clear. Currently our financial application receives multiple feeds in csv format from client, there are usually 100k to 5M rows of data. ...
1
vote
1answer
81 views

Where to put intermediary business logic in a backend

Consider you have a GravityLogic and a WeakForceLogic class. In themselves both provides tons of business logic. Now you want to create interactions between those which produce a complete different ...
0
votes
1answer
35 views

Function for processing files: Business Layer, Service Layer, or anything else?

I read that Repositories should not refer to other repositories. I have a method ProcessFile that refers to multiple repositories, it parses a file, and inserts into many table models in different ...
-3
votes
2answers
143 views

data vs business logic

Today my manager said: 'Amir, don't mix the business logic with data in database'. I surprisingly shocked! I said 'Where?'. According to wikipedia business logic is: In computer software, business ...
0
votes
0answers
222 views

Decoupling logic and data access from service layer

I would appreciate some feedback on the following design choices, also whether the IDisposable pattern I'm using is good in this case. I've tried to follow what Microsoft suggests when implementing ...
0
votes
0answers
75 views

Fluent validation - integrate in my business objects best practices

I am involved in the development of a price engine system. I have a set of business objects like Car, Engine, Wheels, etc I want to validate them using the framework Fluent Validation Here an example:...
13
votes
3answers
394 views

Using static type checking to protect against business errors

I'm big a fan of static type checking. It prevents you from making stupid mistakes like this: // java code Adult a = new Adult(); a.setAge("Roger"); //static type checker would complain a.setName(42)...
2
votes
2answers
166 views

DDD - delegate business rule of domain object to external service

Situation: I am implementing DDD in my first project and I would like to clarify how to correctly implement strategy pattern (in my case check if API token is active). This is a business rule of ...
3
votes
3answers
847 views

Onion architecture: layer placement of business logic

Where should the business logic for a project that utilizes Onion Architecture be placed? In my case, it's a C#-based project, utilizing Web API and possibly a MVC UI for the presentation. But ...
2
votes
2answers
91 views

Communicating the intended operation of API business logic to both developers and business people

Currently, I'm designing the intended operation of a (RESTful) API which a team of developers will eventually build. I'm not concerned with implementation details, as long as inputs are correctly ...
1
vote
0answers
80 views

Business Logic: 3-Layer-Architecture and Rich Domain Model

I have some questions about the "best" underlying architecture of software projects. I know, that there are different similiar posts but I'm really confused because it seems that everybody is telling ...
1
vote
4answers
525 views

Separation of application logic and domain logic in Clean Architecture

I'm struggling with the separation of logic between entities and interactors or Use Cases. If I design the entities with DDD principles, each entity would have methods corresponding to use cases, ...
3
votes
1answer
220 views

How to organize business logic which deals with different, but related objects

The task The piece of software I'm writing operates on the following object types: Agents Calls CallQueues These objects can be linked together, and each of them contains some additional ...
0
votes
1answer
54 views

Is it ok to have transaction at Presentation level?

Let's assume that I have an Order object that has a List<OrderItem> , the user goes to page and creates his order, now I should save his selection to the database, I have two data service ...
0
votes
1answer
74 views

Avoiding concrete references, should expressing relationships be an exception to the rule?

I have a critical business object GroupMembership that represents the relationship between an user and a group. I have set an architectural policy that critical business objects should avoid ...
0
votes
0answers
95 views

SPA on Rails API backend - Business logic and scheduled events

I am creating an API backend on Ruby on Rails. At the front I will be creating multiple client side interfaces to access data. For example a 'member' interface but also separately an 'admin' interface....
0
votes
0answers
48 views

Adding Business Logic into typical MVC + EF structure

We are writing a .net Core MVC Web application, but I think this is a general programming question. This is typically the structure we use with our .net Core MVC Web applications, using dependency ...
4
votes
3answers
126 views

Does Presentation Logic constrain design of Business layer?

We have an email plugin which encrypts a mail's attachments when the user sends an email and gives the mail's recipients permissions to decrypt the attachments. The recipient permissions are stored on ...
-1
votes
1answer
83 views

Should we implement the state machine logic near the data in the “persistence” layer, or bring the data out and implement it in the “listener” layer?

The implementation is MVC. The View is isolated to the browser layer. The Model is isolated to the persistence layer. The Controller is split with: UI controls in the browser mostly so input is ...
5
votes
2answers
819 views

Should Extensions methods be used for Business logic

In C# we have Extension methods. Extension methods enable you to add methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. ...
5
votes
1answer
106 views

Should data model logic live in database schema?

(Apologies if some of my terminology is off, I have not seen much on this subject and am using be best terms I could come up with) Should data model logic live in the database schema? I am making a ...
0
votes
2answers
153 views

Where should I enforce that an entity has between 0 and 7 attributes

Background I need to implement a URL whitelist to limit the number of pages that a javascript widget can be deployed on. The requesting domain is already limited for an account, but I now want to ...
3
votes
1answer
393 views

Domain Objects and How they Access the Database

Suppose I have the following class: public class Course { // data public string Name { get; } public List<Student> Students {get;} //... // logic public int ...
-2
votes
1answer
38 views

Sharing business logic - Web App and Scheduled tasks

Is that okay to share the business logic between a web application and scheduled tasks. Or should the business logic of the scheduled tasks be separated. Currently some of the methods of the business ...
0
votes
1answer
95 views

BLL Layer with physical file path

So I am working on an existing website project that has a BLL layer with some functions that use physical file paths. But now I am creating a console app that will be setup as a windows scheduled ...
0
votes
2answers
175 views

Where to put code for XML Deserialization: Business Logic Layer or Data Access Layer?

I have a web application (ASP.NET Core / C#) with 3 layers (web/presentation, business logic and data access). I'm using Entity Framework to retrieve a record from an SQL Server database which is ...
1
vote
1answer
26 views

is the logic defining how the data should be converted in different formats, presentation or business logic?

In a calendar app adopting a MVC architecture, the Model consists of objects representing the days of the week. The View consists of labels displaying the days as strings or integers, depending on ...
13
votes
2answers
4k views

How exactly should a CQRS Command be validated and transformed to a domain object?

I have been adapting poor-man's CQRS1 for quite some time now because I love its flexibility to have granular data in one data store, providing great possibilities for analysis and thus increasing ...
3
votes
1answer
73 views

Best practices for dynamically-evaluated dates in system?

Let me introduce you into a minimalistic and made-up case with real-case chronological order, updates and problems. User with ID only I had a system, and it had User entity with ID column only. So, ...
0
votes
0answers
106 views

Declarative model for data validation with interdependent values

I'm working on a system, which requires input validation with constraints between different input values. Besides input validation, there should also be inference depending on other configured values. ...
5
votes
2answers
1k views

How to structure business layer logic (app with much complicated business layer logic, calculations etc.)

We are developing a.NET web application that uses WebApi. We have separate layers: UI (HTML, CSS, js etc.) ApiController - receives input DTOs from the UI and calls the appropriate endpoint in the ...
1
vote
3answers
473 views

Organisation of complex business-logic (set of rules)

I have 20 entities and 50 user requests. And i have very complex business-logic (set of rules). How can i make my architecture so I'm not confused when adding new rules. Now if i add property "...
6
votes
1answer
11k views

Business logic vs Service layer

I read this answer: https://softwareengineering.stackexchange.com/a/234254/173318 please correct my understanding. Business rules refers to list of steps of business in real world (no codes). ...
0
votes
3answers
2k views

How to implement business logic with Web Services?

I'am little confused about how business logic should be implemented using web services. For example, think about an education management application. There are simply students, teachers and courses. ...
0
votes
2answers
1k views

How To Design BLL in ASP.NET MVC

I'm trying to design a N-Tier Solution for my existing WebAPI project. I have a WebAPI project where, as of now, all the business logic are written in the controllers and the data validation are done ...
7
votes
3answers
2k views

How acceptable is to keep business logic outside entities (in separate service classes)?

We were taught that objects are self contained things with data and behaviour and therefore they should have methods that act on their attributes. But there are several situations when this coupling ...
6
votes
2answers
315 views

Separating business logic on code

I have a Category and Product tables in database and classes on project. Category class has {id, Name} properties Product class has {id, Name, CategoryId} and other relations. And I have repository ...
3
votes
3answers
150 views

Can a default value for a business process be set in the database column definition?

The business team in my company has come up with a new field to add to one of our entities. For new instances of this entity, it'll be calculated dynamically, but for previously existing instances, we ...
2
votes
4answers
258 views

Design: Should Undo/Redo functionality be part of the business layer of an app?

We're developing a big application with a vast GUI and complex business layer. Without going into too much detail, the application is currently implemented in a rich native client, but functionality ...
11
votes
3answers
937 views

Entity Framework and avoiding the Anemic Domain Model

In our business logic we occasionally have methods defined something like this: User.ResetCourse(Course courseToReset) The problem is that both User and Course are Entity Framework proxy objects. ...
2
votes
4answers
87 views

Should I unit test the consuming class or the class running the logic?

I have a similar scenario to this: public class VatCalculator { public decimal GetValueWithVat(decimal value, decimal? vatRatePercentage) { if(vatRate == null) { ...
0
votes
1answer
651 views

Decoupled architecure between business and data layers in Spring JPA / Hibernate

I'm using Spring Boot with JPA / Hibernate and I'm trying to decouple the business layer from the data layer. I would like to be able to (relatively easily) switch from a relational database to a rdf ...
0
votes
1answer
73 views

Best practice for Managing 1200 Counties data for 56 states

I have a complex problem to be solved, I have several excel files containing data from over 1200 counties from 56 states. Problem is that most of the counties has some columns which are different from ...
2
votes
2answers
130 views

Should this be on the level of ORM or level of business objects?

We have three levels of code in our big and complex Web site: plain SQL (in fact Perl DBI), a primitive ORM (we wrote our own primitive ORM, because DBIx::Class appeared too slow in our environment), ...
3
votes
1answer
93 views

in which layer should “partial” BL method be placed?

I have a project and I follow Repository and UoW patterns. I also have a "service" layer which I also use as my BL layer. Taking for example a Customer domain model, I might have information that I ...
14
votes
6answers
8k views

When should I use stored procedures?

If I have all my business logic in code and make use of Entity Framework, in what situations (if any) would I be better moving some business logic to a stored procedure, instead of keeping it all in ...
2
votes
2answers
85 views

How can I provide a user edit-level control over currently hardcoded formulas?

Current Situation I maintain a website that has a simple form that users fill out with simple engineering data. They press Submit, and the PHP code takes over and does various basic arithmetic on ...