Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7580515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:56:13+00:00 2026-05-30T17:56:13+00:00

Assume you have a database where you store the information about a ticketing system

  • 0

Assume you have a database where you store the information about a ticketing system (like helpdesk). The (simplified) schema is:

  1. Ticket (TicketId(PK), TicketDesc, TicketCreated, TicketClosed,
    AssignedToEmployee(FK))

  2. Employee (EmployeeId(PK), EmployeeName, EmployeeFunction)

Where there is a one many relationship between Ticket and Employee on AssignedToEmployee = EmployeeId.

You have to develop an MVC application (DAL composed by EF entities + Repository class) that displays graphs and statistics about tickets, such as Number of Tickets Assigned to users in a specific time period. In order to calculate the statistics and provide the values for the graph to the View, you need to perform some logic.
This logic can be put in the Controller or in the Repository. Since the Controller has to be kept as slim as possible and the implementing logic within the Repository will increase coupling with the database, what is the best in this case?
Create a Service layer or create database views? In the latter case, the created views are to be considered entities within my EF?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:56:15+00:00Added an answer on May 30, 2026 at 5:56 pm

    I’d create a service layer. Controllers are really part of View, in my opinion. Repositories should not be doing calculations. You need the Service in-between. This arrangement will have a number of advantages:

    1. Services can be reused by other apps in a SOA.
    2. Services can be exposed using any number of remoting techniques (SOAP, REST, XML-RPC, etc.)
    3. Services are the natural owners of units of work; they should manage connections and transactions.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to store long strings in MySQL database using spring roo. I assumed
Assume I have a C# class like this: [XmlRoot(floors)] public class FloorCollection { [XmlElement(floor)]
Assume I have the following input in Pig: some And I would like to
I have some MySQL database server information that needs to be shared between a
I have a relatively simple case. I basically want to store data about links
First of all, let's define a few tables: Users table will store information about
How would I go about storing potential SQL injection attacks in a database? Assume
Assume we have a popular site. We need to implement mail-like messaging between users.
I have a List of Strings I need to store locally (assume the list
in our system we store orders. We always have customer specific code in our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.