Hot answers tagged

6

I will focus on the two core problems described in your question: Soon there are like hundreds of configurable options, and even naming them becomes a nightmare, let alone managing them, changing them, tracking them in code The naming problem can be solved by organizing them in hierarchies. For example, look at the thousands of options you will find in ...


5

I agree with SO's LoztInSpace that this is quite opinionated answer and that everyone can have slightly different definitions. Especially if historical influences are involved. This is how I would define the terms: Business logic is logic, that is created with collaboration and agreement with business experts. If business expert says that "Customer cannot ...


5

Nested conditions along the lines of ((foo or bar) and baz) are hard to comprehend, and I understand that you want to avoid them. Indeed, you can avoid the logical operators and, or and not if you allow conditionals to be nested: if (foo and bar) then action is equivalent to if (foo) then if (bar) then action if (foo or bar) then action is ...


4

In layman's terms: Imagine this: in the eighties you wrote a piece of software that allowed people to track their personal finance. That software showed reports in text-only mode in a phosphor screen and saved data to diskette files. Later in the nineties you rewrote the program to work in Windows graphical environment. You had to make cool windows and ...


3

I read on the internet that I should do as less as possible in the controller. What do they mean? They mean the Controller is a part of the UI. And you should do only UI-related things inside it. If you need to so something with your model data, you place those actions into another layer (bussiness layer, logic layer, call it whatever you like) and ...


3

So just going purely on the limited information in your description, the common base class seems like an appropriate place to put common processing logic.


3

I think the SA is right. (in that you should have actions in the actions table) But for more concrete reasons than just 'align with business definitions' 1: By adding the exta cols to highlight you have broken the normalisation of that table. 2: you presumably do stuff with actions, now you have to check two places to get them all. breaking the single ...


2

There are several options you can consider to tackle this problem at the design level. Pattern-wise, you might want to get yourself a refresher about, including, albeit not limited to: The abstract factory design pattern http://www.dofactory.com/net/abstract-factory-design-pattern which could maybe used in combination with: The strategy design pattern ...


2

It still belongs in a model, just not a view model. Since MVC assumes you are working in the UI they omit a "V"... View-Model View Controller, VMVC does not have the same ring to it. If your application is trivial, your view model and business model can be the same thing, and that's okay. But it sounds like you application is past that point. public class ...


2

The whole point of MVVM is to abstract as much logic as possible away from the View, the surface that the user sees. If you're using CodeBehind to implement business logic, you're probably not practicing MVVM. This has several benefits: It makes the code more testable. UI is difficult to test, especially UI that has CodeBehind. If the business logic is ...


2

The way you describe it, I would put the code to update the balance in a separate UpdateBalanceService-class. Then create a new class 'RefreshBalanceService' that contains both the UpdateBalanceService and a ProcessNewFeesService. The UpdateBalanceService-class would then call both services and perform the necessary actions. It is then a matter of ...


2

The following query: SELECT a.user_id AS a_user_id, b.user_id AS b.user_id, a.question_id, a.answer FROM answers AS a INNER JOIN answers AS b ON a.question_id = b.question_id AND a.answer = b.answer; WHERE a.user_id <> b.user_id; will give you a long, long table with all identical answers by all users. You ...


2

Possibly, but if these contact records are going to be entered by employees, it is perfectly possible that you could have a difference in address/name/phone number styles that would make this difficult. E.g. for address: 1 High Street 1, High Street 1 High St This applies across columns too: Joe Smith|1 High Street Jo Smith|1 High St I'd also ...


1

What you want to do is called a three-way merge. Basically, you take the original before the branch, and the end result of the two branches. You take the differences between both branches and the original, and merge those diffs together. How do you merge the diffs? That's the tricky part, but here are several projects which implement the algorithm for ...


1

"Business Logic"* is the part of your application which deals exclusively with the rules, processes, and algorithms that are necessary in order to solve the problem at hand (in other words, for the application to fulfill its raison d'ĂȘtre) without any concern whatsoever to peripheral concerns such as precisely how to receive input from the user, precisely ...


1

People who work in software product lines frequently wrestle with the same problems - how to write software that can vary depending on the deployment environment. There are several methods that have been identified to manage variability - build-time configuration, plug-in architecture models, run-time configuration of properties, configuration files, ...


1

You can associate vouchers with orders as Muhammad suggested and use ajax to check availability. Count all vouchers for open and paid orders. Don't count vouchers for cancelled orders. This way someone might not be able to use a voucher, but later someone else might. If that first someone complains about that, make sure, you have one extra stock item that ...


1

First and foremeost, you seriously need to isolate business logic from Views. You don't need to do it all at once, but with new feature requests, you really need to workout a better distribution of roles in your application. Secondly, Strategy Design Pattern is exactly what you need in your application: The idea of the pattern is to eliminate hard ...


1

As others have pointed out, these terms do not have one universally accepted meaning. I will describe the definitions I have encountered more often, i.e. in several projects with different companies. The business logic defines a normalized, general-purpose model of the business domain for which an application is written, e.g. Classes like Customer, Order, ...


1

Every system or application is going to have its own definitions of what is business logic and what is application logic. It will either be explicit or implicit. In my experience data driven applications (e.g. DBs etc.) tend to have a more formal definition of what the business logic is. The application logic tends to focus on getting information from ...


1

Na, they're just different terms for the same thing - the "middle tier" of program code that does the things you want your program to perform. Like many things in software, there are no hard-and-fast terminology for pieces of a system, as there are no single formal definitions for building systems. So sometimes people will call it business logic, others ...


1

It seems to me like you're putting the cart a bit before the horse, especially since you have a partial implementation already. Take a step back and ask yourself what "all" means and what purpose it serves. In this case it means "without conditions or filters", and the purpose is to provide a way for the user to tell the system "I don't care what the tags ...



Only top voted, non community-wiki answers of a minimum length are eligible