Questions tagged [business-logic]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
14 votes
6 answers
4k views

Separating business logic from data tempts me to use instanceof

class Foo { abstract doStuff() {} } class Bar extends Foo { doStuff() { ... } } class Baz extends Foo { doStuff() { ... } } From a functional perspective doStuff does exactly the same ...
user avatar
-3 votes
1 answer
60 views

How to document business processes/rules inside Python code and export them?

I'm in a project that computes a lot of metrics with Python code. We need to document how each metric is computed, inside the code, for readability, and outside, in some Wiki, for non-technical people....
user avatar
1 vote
1 answer
161 views

Should transactions be placed in the business layer?

I need transactions in my service to ensure data consistency. I don't know what the best layer is for transactions to be created in. The goal is to have all business logic in a single layer. First, ...
user avatar
  • 139
3 votes
2 answers
127 views

Getting the UI to know about Business Rules for Form Controls

Situation: VB.NET WinForms application, using the WinForms as a presentation layer project. Another class library project containing the business layer, in the form of CQS and Service classes, plus a ...
user avatar
  • 604
0 votes
1 answer
80 views

Storing Sort Order in Database: match the business logic or the application logic? [closed]

Take a profile page for a job applicant with a list of names in a form with typical CRUD: Resume Name: Altenrate Name 1: Alternate Name 2: Alternate Name 3: Assuming we have some sort of Names table ...
user avatar
  • 1,339
1 vote
3 answers
107 views

Keeping business logic separate from data access

Let's say I have few entity classes: class EntityA { LocalDate date1; LocalDate date2; } class EntityB { } class EntityC { LocalDate date1; } and I want to pass them through some logic containing ...
user avatar
  • 19
3 votes
1 answer
141 views

How to make a business case for incremental product development

I don't work for an development company, but we have been working in partnership with one to develop an application for use internally within our business. The application is somewhat "niche&...
user avatar
  • 149
2 votes
3 answers
196 views

domain model logic behavior (ddd)

How domain model capture business logic / domain logic since i cannot access repository? I see many posts saying that domain model = business objects But Business objects live in application layer (...
user avatar
0 votes
2 answers
125 views

Does it make sense to inform SPA frontend about business rules from the backend?

Let's say you have a user registration form in your frontend. In both, backend and frontend, password is valited so it has to match a set of requirements: more than 6 characters, no symbols, etc... ...
user avatar
  • 717
0 votes
2 answers
408 views

Patterns for returning messages/results from business logic to UI

Cross-posting from SO. Is there a name for the patterns used send messages/errors and results through an application's layers from business logic/database to the UI? What is the modern way? For ...
user avatar
  • 369
2 votes
2 answers
1k views

Where should "query" business logic be placed in Domain-driven design?

System description This is a simple eCommerce application containing a Products inventory managed by an Admin. The Products in inventory/repository will show in the User App. Admin has the ability to ...
user avatar
  • 129
1 vote
3 answers
201 views

Is creating an entity in a database considered to be business logic?

According to my (perhaps incorrect) understanding business logic includes saving/updating entities in the database, as well as connecting with any 3rd party API's or using services and should ...
user avatar
  • 145
1 vote
2 answers
112 views

Implement business logic as dictionaries of delegates

In my application I'm dealing with periods. A period is defined by it's end date. A period may shrink or grow, can restart and can have a priority. This is modeled using the following struct: public ...
user avatar
1 vote
1 answer
404 views

Upholding business logic and invariants in an event sourced CQRS architecture

My understanding of a CQRS architecture is that a micro-service is split to two servers each with its own database such that the first server handles all the writes and the second server handles all ...
user avatar
  • 13
2 votes
1 answer
174 views

How to model Business Objects depending on use cases?

I'm having trouble modeling the Business Objects of my application. In my domain I have substantially a list of bills of orders, and for every bill I have the pallet that contains the materials to ...
user avatar
  • 59
4 votes
1 answer
1k views

Where should I place more complex business logic related to what a Web API does but consumed by a single client?

I have been debating with my colleagues about the following and we still did not reach consensus. The architecture is as follows: medium size monolith application for intranet usage a small ...
user avatar
  • 424
1 vote
1 answer
339 views

Where to place the business logic for an external application that is tightly coupled with an internal application and how to adapt the architecture?

I and a colleague had a rather strange discussion with our boss related to the architecture of the applications we are currently developing. The C4 (second level) diagram of the existing architecture ...
user avatar
  • 424
4 votes
1 answer
2k views

DDD and MediatR - where the Validation and Business Logic go

I'm trying to get to grips with Domain Driven Design and MediatR. A reaction to being involved with applications that favour Services for almost everything. I see so much value in DDD and I'm trying ...
user avatar
  • 263
0 votes
0 answers
129 views

How to handle various types of custom logic in multi-tenancy architecture

In a microservice based multi-tenant web application, there are some cases of tenant specific logic where I am unclear about the proper strategy to handle them. Thank you for pointers. These two ...
user avatar
  • 109
5 votes
2 answers
387 views

How to clean up a business logic class that does too many things without injecting a ton of classes into it?

Let's say we have business logic to perform in an MVC framework after a user submits a form: class BusinessLogic: def sendDataTo3rdPartyApi(self): # do stuff def validateResponse(self)...
user avatar
3 votes
2 answers
297 views

DDD, Aggregate Root and entities in library application scenario

I'm building a library application. Let's assume that we have a requirement to let registered people in the library to borrow a book for some default period of time (4 weeks). I started to model my ...
user avatar
5 votes
1 answer
452 views

Is My Data Access Layer Really My Domain?

I'm not an architect, but am trying to put together a diagram which represents the architecture of the application which I am maintaining. I have one question (but welcome any comments about the ...
user avatar
3 votes
1 answer
252 views

What domain objects might I need to represent a user and users profile in a forum web application

I’ve been trying to get a firm understanding of the MVC design pattern so that I can write my own framework for implementing the back-end of a forum web application using Slim 3. In particular, after ...
user avatar
10 votes
5 answers
736 views

Presentation Layer Accessing Business Logic

I've been reading a lot of material lately about DDD (business entity objects) and other common patterns in n-tiered(layered) architecture. One thing I have issue with is, most articles, blogs, ...
user avatar
  • 604
-1 votes
1 answer
122 views

How to generalize this method for its duplicate/common logic?

I've a method that apparently has quite some duplicate logic, I'd like to generalize it so that their duplicate logic could be shared and reused, also make my code more extensible for future additions....
user avatar
3 votes
3 answers
341 views

Possible alternatives to excel as business logic implementation

I just started my internship as a computer science student. The project I'm working on is web based price calculation. Previously, the price calculation have been done in a quite huge excel ...
user avatar
  • 51
-1 votes
1 answer
72 views

How process dynamic rules for product configuration?

I need to find a software architecture to support object configuration and validation in a dynamic environment. Lets say I want to configure a bike where I have many physical components available to ...
user avatar
0 votes
2 answers
991 views

DDD How to populate AggregateRoot from Repository when properties and collections should be readonly

If the entity should be always in valid state (therefore the properties are readonly and can be set only by methods which contains validation), How can I build this entity inside Repository without ...
user avatar
  • 185
-2 votes
1 answer
209 views

Documenting business logics of legacy application having no unit test

I have joined a team in company and this team owns few services, which are used widely by many other user facing internal/external UI apps and other internal apis. My manager gave me rough idea that ...
user avatar
  • 181
14 votes
3 answers
7k views

Where should business logic sit in microservice architecture?

Still trying to wrap my head around microservice architecture since I'm used to a monolithic approach Suppose we try to build a extremely simplified Uber booking system. To simplify things we let's ...
user avatar
  • 263
2 votes
2 answers
128 views

How thoroughly should you document business flows for a product or system you are learning?

I work on applications that have user documentation but it is not organized or updated to the current release. Is it worth my time to create my own documentation with screenshots and notes on all the ...
user avatar
3 votes
3 answers
1k views

Aggregation of data from two Microservices

I have two Microservices A and B. B Microservice has a large set of an entity called User. A Microservice stores the User entity in its own DB if User is configured by an agent. There is no flag ...
user avatar
2 votes
1 answer
1k views

In MVC + SOA Architecture, What is the Rationale for Placing Business Logic in Models?

When writing web applications I place business logic in controllers. This has worked well for my small App Dev team- our applications run reliably, perform well, and the code is easy to maintain. ...
user avatar
4 votes
2 answers
1k 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 ...
user avatar
  • 396
2 votes
3 answers
298 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 ...
user avatar
  • 396
3 votes
3 answers
5k 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 ...
user avatar
1 vote
4 answers
964 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. ...
user avatar
  • 19
1 vote
1 answer
155 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 ...
user avatar
0 votes
1 answer
121 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 ...
user avatar
0 votes
2 answers
2k 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 ...
user avatar
13 votes
3 answers
456 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)...
user avatar
  • 259
3 votes
2 answers
1k 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 ...
user avatar
  • 289
6 votes
3 answers
5k 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 ...
user avatar
2 votes
2 answers
256 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 ...
user avatar
5 votes
4 answers
6k 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, ...
user avatar
4 votes
1 answer
1k 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 ...
user avatar
0 votes
1 answer
84 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 ...
user avatar
  • 349
0 votes
1 answer
84 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 ...
user avatar
6 votes
3 answers
422 views

Is it good practice to put service business logic based on audit trail?

Our application creates audit trails in response to system actions and user actions. Our business logic depends on these audit trails to find out which user performed what action. Is it good practice ...
user avatar
4 votes
3 answers
307 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 ...
user avatar