business-logic-layer

Logic: Database or Application/2 (constraints check)

笑着哭i 提交于 2019-11-30 13:26:21
This is a specific version of this question . I want to check if I am inserting a duplicate row. Should I check it programmatically in my application layer: if (exists(obj)) { throw new DuplicateObjectException(); } HibernateSessionFactory.getSession().save(obj); or should I catch the exception thrown by the database layer and triggered when I violate the contraint? try { HibernateSessionFactory.getSession().save(obj); } catch(ConstraintViolationException e) { throw new DuplicateObjectException(); } EDIT: In other words: though the constraint is there to remain (it's good database design

Domain objects/services and the Business Logic Layer

泄露秘密 提交于 2019-11-28 15:43:49
What are domain objects and domain services in software architecture? I am not familiar with them or how they differ from the business logic layer? Different people use these terms in somewhat different ways, but here's my take: 1) "Business" and "domain" are roughly synonyms. "Domain" is a bit more general in that it doesn't make the assumption that you're writing a business application. So if we were writing a scientific app or a game, we might prefer to refer to the relevant part of the code as "domain" code rather than "business" code. So in the remainder of this explanation I'll use

Where does the “business logic layer” fit in to an MVC application?

青春壹個敷衍的年華 提交于 2019-11-27 16:39:32
First, before anyone screams dupe, I had a hard time summarizing it in a simple title. Another title might have been "What is the difference between a domain model and MVC model?" or "What is a model?" Conceptually, I understand a Model to be the data used by the views and controller. Beyond that, there seems to be a great deal of differing opinions on what makes up the model. What's a domain model, versus an app model, vs a view model, vs a service model, etc.. For example, in a recent question I asked about the repository pattern, I was told point blank that the repository is part of the

Business Layer in 3 tier Architecture

纵饮孤独 提交于 2019-11-27 12:14:34
I went for an interview, and was asked to show up my Business layer architecture. I have some idea about 3 tier architecture but really no idea, to what to write in front of interviewer. So suppose my project deals with Employees of an organization, then what would i have written there. Will it be any kind of diagrams i should have made or some coding part. I worked in C# framework 3.5. I really don't understand what else to mention in this question, so please let me know if something is required.Thanks. Edit I worked in winforms. I know what Business layer is, but was not sure what to tell

Domain objects/services and the Business Logic Layer

纵然是瞬间 提交于 2019-11-27 09:21:31
问题 What are domain objects and domain services in software architecture? I am not familiar with them or how they differ from the business logic layer? 回答1: Different people use these terms in somewhat different ways, but here's my take: 1) "Business" and "domain" are roughly synonyms. "Domain" is a bit more general in that it doesn't make the assumption that you're writing a business application. So if we were writing a scientific app or a game, we might prefer to refer to the relevant part of

Where does the “business logic layer” fit in to an MVC application?

旧时模样 提交于 2019-11-26 18:44:00
问题 First, before anyone screams dupe, I had a hard time summarizing it in a simple title. Another title might have been "What is the difference between a domain model and MVC model?" or "What is a model?" Conceptually, I understand a Model to be the data used by the views and controller. Beyond that, there seems to be a great deal of differing opinions on what makes up the model. What's a domain model, versus an app model, vs a view model, vs a service model, etc.. For example, in a recent

Business Layer in 3 tier Architecture

瘦欲@ 提交于 2019-11-26 18:08:33
问题 I went for an interview, and was asked to show up my Business layer architecture. I have some idea about 3 tier architecture but really no idea, to what to write in front of interviewer. So suppose my project deals with Employees of an organization, then what would i have written there. Will it be any kind of diagrams i should have made or some coding part. I worked in C# framework 3.5. I really don't understand what else to mention in this question, so please let me know if something is

Entity Framework And Business Objects

十年热恋 提交于 2019-11-26 17:46:55
I have never used the entity framework before and i would like to try some personal projects implementing it to get my feet wet. I see that entities can be exposed to the presentation layer. But i don't want certain fields exposed, fields like modified dates and created dates and various other database fields. how could i implement Business objects and just expose the properties i need but still keep the objects serializable? Also what advantages does this have over LinqToSql? Ladislav Mrnka When you define an entity in the EDMX model you can specify the visibility of each property's setter

Separation of business logic and data access in django

久未见 提交于 2019-11-26 13:54:31
I am writing a project in Django and I see that 80% of the code is in the file models.py . This code is confusing and, after a certain time, I cease to understand what is really happening. Here is what bothers me: I find it ugly that my model level (which was supposed to be responsible only for the work with data from a database) is also sending email, walking on API to other services, etc. Also, I find it unacceptable to place business logic in the view, because this way it becomes difficult to control. For example, in my application there are at least three ways to create new instances of

Entity Framework And Business Objects

徘徊边缘 提交于 2019-11-26 05:37:12
问题 I have never used the entity framework before and i would like to try some personal projects implementing it to get my feet wet. I see that entities can be exposed to the presentation layer. But i don\'t want certain fields exposed, fields like modified dates and created dates and various other database fields. how could i implement Business objects and just expose the properties i need but still keep the objects serializable? Also what advantages does this have over LinqToSql? 回答1: When you