Questions tagged [business-logic]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

Balancing logic placement in the domain and general perfomance of the system

I am writing my first application using DDD (in Node with TS) and I started writing all the domain first -- before starting the repositories/DB and then the application, while writing unit tests for ...
Bernardo Benini Fantin's user avatar
0 votes
1 answer
58 views

Validating data and logic outside the domain

I have a budget entity in my domain which can be closed by the user if the budget is open. This means if the budget opens today and closes in seven days, in between this time I can close it, not ...
Bernardo Benini Fantin's user avatar
1 vote
2 answers
173 views

Placing business logic on a not so small/big project

I am having a bit of problem trying to find the correct place for business logic. The project I am working on isn't huge, but is not small either and has a very considerable importance in my company. ...
Bernardo Benini Fantin's user avatar
1 vote
3 answers
377 views

How do you record and track your business logic for software projects?

In my work, which is a UK university, we currently have no specific way of recording and tracking business logic and rules as they arise from stakeholders for our in-house software projects. We use ...
Stephen Beale's user avatar
3 votes
1 answer
527 views

How would you implement a promotion/discount system?

Two recent failed projects in my career involved trying to implement a discount/promotional offer system for retail. For example, a retailer may want to offer discount codes in emails or newsletters, ...
user3243135's user avatar
0 votes
2 answers
131 views

Services: Which structure is a better idea?

I'm designing my service layer for a GraphQL API and there are many situations in which I can't decide if code relating to a table should belong in it's own class, or the class that 'owns' the data. ...
J Doe's user avatar
  • 101
1 vote
2 answers
152 views

Strategies to abstract away technical details when dealing with transactions

I like programming in such a way that every component/injectable of the applications I build, has a clearly defined scope, and it's easily tested. With years working as a Developer I've come to ensure ...
caeus's user avatar
  • 129
1 vote
0 answers
185 views

Business rule or repository implementation rule in Clean Architecture

I'm studying Clean Architecture with python and got into this "problem" of choosing where to implement a rule (that I considered a Business Rule, maybe I'm wrong) I have 2 Entities @...
Rodrigo Maller Martins's user avatar
-1 votes
2 answers
138 views

How to make domain objects accessible to MVC controllers and views?

Summary of my question in a short form: How to propagate changes of domain objects upwards without introducing application logic into them? Following 'facts' are based on prescriptions from respected ...
reign's user avatar
  • 125
0 votes
1 answer
75 views

Good approach to design Business interface for versioned API?

I am designing an API using .NET core 6 C# which has 2 versions. For v1 I have something like the following for the business logic interface (fictional names and simple fields just to facilitate ...
the-4th's user avatar
  • 101
14 votes
6 answers
5k 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 ...
Alexandre DUPONCHEL's user avatar
-3 votes
1 answer
601 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....
Be Chiller Too's user avatar
1 vote
1 answer
1k 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, ...
Lucas's user avatar
  • 139
3 votes
2 answers
212 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 ...
HardCode's user avatar
  • 634
0 votes
1 answer
143 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 ...
8protons's user avatar
  • 1,369
1 vote
3 answers
955 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 ...
t3h_b0t's user avatar
  • 19
3 votes
1 answer
176 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&...
ainwood's user avatar
  • 149
2 votes
3 answers
495 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 (...
Stelios's user avatar
  • 205
0 votes
2 answers
304 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... ...
Héctor's user avatar
  • 727
0 votes
2 answers
2k 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 ...
GisMofx's user avatar
  • 379
2 votes
3 answers
3k 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 ...
Krishnan's user avatar
  • 129
1 vote
3 answers
387 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 ...
Yos's user avatar
  • 157
1 vote
2 answers
142 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 ...
Bill Tür stands with Ukraine's user avatar
2 votes
1 answer
804 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 ...
VOLK 14's user avatar
  • 23
2 votes
1 answer
244 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 ...
Ivan's user avatar
  • 69
3 votes
1 answer
3k 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 ...
Alexei's user avatar
  • 452
1 vote
1 answer
844 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 ...
Alexei's user avatar
  • 452
5 votes
1 answer
4k 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 ...
David C's user avatar
  • 273
0 votes
0 answers
288 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 ...
tscherg's user avatar
  • 109
5 votes
2 answers
637 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)...
Robert Calove's user avatar
3 votes
2 answers
564 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 ...
XardasLord's user avatar
5 votes
1 answer
827 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 ...
onefootswill's user avatar
3 votes
1 answer
342 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 ...
SneakyShrike's user avatar
10 votes
5 answers
1k 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, ...
HardCode's user avatar
  • 634
-1 votes
1 answer
157 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....
Fisher Coder's user avatar
4 votes
3 answers
448 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 ...
Hiromi's user avatar
  • 61
-1 votes
1 answer
101 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 ...
João Pedro Schmitt's user avatar
0 votes
2 answers
1k 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 ...
Muflix's user avatar
  • 195
-2 votes
1 answer
262 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 ...
PKV's user avatar
  • 181
17 votes
3 answers
9k 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 ...
GantengX's user avatar
  • 303
2 votes
2 answers
131 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 ...
Puneeth mypadi's user avatar
2 votes
1 answer
2k 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. ...
Erik Madsen's user avatar
5 votes
2 answers
2k 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 ...
Hans's user avatar
  • 416
2 votes
3 answers
633 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 ...
Hans's user avatar
  • 416
3 votes
3 answers
6k 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 ...
user9923760's user avatar
1 vote
4 answers
1k 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. ...
arun kumar's user avatar
1 vote
1 answer
206 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 ...
Kévin Isabelle's user avatar
1 vote
1 answer
159 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 ...
CarSpeed87's user avatar
0 votes
2 answers
3k 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 ...
Amish Shabani's user avatar