business-logic

Business Logic: Database or Application Layer

蹲街弑〆低调 提交于 2019-11-27 03:57:23
问题 The age old question. Where should you put your business logic, in the database as stored procedures ( or packages ), or in the application/middle tier? And more importantly, Why? Assume database independence is not a goal. 回答1: Put enough of the business logic in the database to ensure that the data is consistent and correct. But don't fear having to duplicate some of this logic at another level to enhance the user experience. 回答2: Maintainability of your code is always a big concern when

Business logic in MVC

你。 提交于 2019-11-27 02:20:36
I have 2 questions: Q1. Where exactly does "business logic" lie in the MVC pattern? I am confused between Model and Controller. Q2. Is "business logic" the same as "business rules"? If not, what is the difference? It would be great if you could explain with a small example. Business rules go in the model. Say you were displaying emails for a mailing list. The user clicks the "delete" button next to one of the emails, the controller notifies the model to delete entry N, then notifies the view the model has changed. Perhaps the admin's email should never be removed from the list. That's a

ASP.NET MVC - Should business logic exist in controllers?

喜夏-厌秋 提交于 2019-11-26 14:51:21
Derik Whitaker posted an article a couple of days ago that hit a point that I've been curious about for some time: should business logic exist in controllers? So far all the ASP.NET MVC demos I've seen put repository access and business logic in the controller. Some even throw validation in there as well. This results in fairly large, bloated controllers. Is this really the way to use the MVC framework? It seems that this is just going to end up with a lot of duplicated code and logic spread out across different controllers. Business logic should really be in the model. You should be aiming

Case-insensitive attribute-value selector with Jquery

℡╲_俬逩灬. 提交于 2019-11-26 14:28:58
问题 I need to get the value of the content attribute of a certain meta tag. var someContent = $("meta[name=someKindOfId]").attr("content"); is how I usually do it. For business reasons, someKindOfId may be somekindofid . It could be other combinations of cases as well. I don't know. What is the best way to search for this meta tag? Adding an id or other identifier is out of the question. 回答1: You could use the jquery filter function like so var meta = $('meta[name]').filter(function() { return

MVC: Where to put business logic?

萝らか妹 提交于 2019-11-26 11:55:38
问题 First of all, I have seen many questions of this, but not enough reasoning behind that. If my question is not good enough and should be removed I\'ll understand. I have taken a look at, for example, this and a 45+ voted up answer says he advises you to put the business logic in the model, which sounds pretty logical. However, my first large project I have done with all my BL fully in the controllers, because I didn\'t question these things and looked how it is done in the AccountController

Business logic in MVC

梦想与她 提交于 2019-11-26 06:51:15
问题 I have 2 questions: Q1. Where exactly does \"business logic\" lie in the MVC pattern? I am confused between Model and Controller. Q2. Is \"business logic\" the same as \"business rules\"? If not, what is the difference? It would be great if you could explain with a small example. 回答1: Business rules go in the model. Say you were displaying emails for a mailing list. The user clicks the "delete" button next to one of the emails, the controller notifies the model to delete entry N, then

Service layer and controller: who takes care of what?

…衆ロ難τιáo~ 提交于 2019-11-26 06:29:54
问题 In class we\'re now learning how to build up a Spring application, even though spring isn\'t directly involved, we learned how to make the interfaces for DAO and service layer objects. Please correct me if I\'m wrong: DAO layer is pretty abstract: it just contains the CRUD operations and is further used to read data.(ie: get all objects, get specific objects, etc) Service layer: contains services to create things, and delete things, this is where business logic should be. Now all of this