Questions tagged [business-logic]

Business logic is the abstract thought process behind decision making in human transactions. Translation of business logic into code is one of the major tasks in producing business software.

626 questions
8
votes
6 answers

Dynamic Business Rules in a web application

Greetings! Working on a web based project were business rules and logic need to be customized by client. I want to do this without having to recompile the application every time we sign up a new client on the system. The architectures I have…
8
votes
10 answers

Should Business layer of the application be able to access Session object?

Say you have 3 layers: UI, Business, Data. Is that a sign of poor design if Business layer needs to access Sessions? Something about it doesn't feel right. Are there any guidelines to follow specifically tailored to web app? I use c# 2.0 .net
sarsnake
  • 26,667
  • 58
  • 180
  • 286
8
votes
5 answers

WCF Service and Business Logic

I am unsure where to place my business logic. I have a WCF service which exposes its methods to my client. Should my business logic go in the service method public User GetUser(int id) { //Retrieve the user from a repository and perform…
ministrymason
  • 1,783
  • 2
  • 20
  • 33
8
votes
3 answers

Is it a good or a bad thing that a suite of quickcheck tests match the implementations?

I'm trying to get started with Haskell's QuickCheck, and while I am familiar with the concepts behind the testing methodology, this is the first time I am trying to put it to use on a project that goes beyond testing stuff like reverse . reverse ==…
8
votes
3 answers

Repository, Service or Domain object - where does logic belong?

Take this simple, contrived example: UserRepository.GetAllUsers(); UserRepository.GetUserById(); Inevitably, I will have more complex "queries", such as: //returns users where active=true, deleted=false, and confirmed = true GetActiveUsers(); I'm…
8
votes
5 answers

Should the ID in the business object be read-only or not?

In my mind the ID field of a business object should be read-only (public get and private set) as by definition the ID will never change (as it uniquely identifies a record in the database). This creates a problem when you create a new object (ID not…
Anthony
  • 7,210
  • 13
  • 60
  • 70
8
votes
1 answer

Where should business logic (and what is that?) really live and how to do that with Spring?

I was just reading this article: http://www.tutorialized.com/view/tutorial/Spring-MVC-Application-Architecture/11986 which I find great. It explains the layer architecture nicely and I was glad that the architecture I'm working with pretty much is…
marc82ch
  • 1,004
  • 3
  • 11
  • 27
7
votes
3 answers

Which layer do functions like: caching and logging belong?

Let's say my business layer currently contains a bunch of DTO's and separate service classes to communicate with the data repository. Example: class PersonService { IPersonRepository _personRepository; ILogging _logger; ICacheStorage…
Mike
  • 2,912
  • 4
  • 31
  • 52
7
votes
2 answers

Is it a bad idea to use a database's primary key as business object identifier?

I wonder, is it bad or good idea to use auto increment primary key as business entity identifier such as Partner Id or Account Number? Also, what pitfalls I can face if I'll choose that approach?
Vokinneberg
  • 1,912
  • 2
  • 18
  • 31
7
votes
1 answer

How to use FluentValidation within c# application

I am building an application that has the following layers Data - Entity Framework Context Entities - Entity Framework POCO objects Service - Called by WebApi to load/save entity WebApi - Now i believe that i should put my business logic into the…
Gillardo
  • 9,518
  • 18
  • 73
  • 141
7
votes
6 answers

Business Layer Logic (BLL) is about data?

I think BLL is about Data. It should not include a method called SendEmail. BLL is a place for caching data, manipulating it, doing calculations related to business. Sending email is a business process but the code which actually send the email…
Costa
  • 3,897
  • 13
  • 48
  • 81
7
votes
1 answer

Where to put such business logic? Service vs DAO?

Given: Spring MVC - Hibernate. Controller -> Service -> DAO Now I have a method which retrieves something from the DB and EVERYTIME it does this, has to do another method say "processList" (something like just changing some values in the list…
Rey Libutan
  • 5,226
  • 9
  • 42
  • 73
7
votes
1 answer

Zend Framewok 2, Doctrine 2 and where do Business logic fit in

Consider that I want to be able to save a user to the database, my add action is as follow: public function addAction() { $form = new UserForm(); $form->get('submit')->setValue('Add'); $request = $this->getRequest(); if…
uacaman
  • 418
  • 1
  • 5
  • 15
7
votes
10 answers

Getting rid of hard coded values when dealing with lookup tables and related business logic

Example case: We're building a renting service, using SQL Server. Information about items that can be rented is stored in a table. Each item has a state that can be either "Available", "Rented" or "Broken". The different states reside in a lookup…
Mika
  • 71
  • 1
  • 2
7
votes
2 answers

How to avoid anemic domain model with business logic in the form of rules

I am designing a system that has a simple Entity Framework backed domain object that has fields I need to update based on a series of rules - I want to implement these rules progressively (in an agile style) and as I am using EF I am sceptical about…