service-layer

Linq2Sql - How do you lazy load nested lists?

How do you lazy load nested lists without actually executing the query? Using a very basic example, say I have: class CityBlock { IList<Building> BuildingsOnBlock; Person BlockOwner; } class Building { IList<Floor> FloorsInBuilding; } class Floor { IList<Cubicle> EmployeeCubicles; } Class Cubicle { System.Gui...

Purpose of the service layer

Am I correct in thinking that the purpose of a service layer includes the following? thinning out of domain models (i.e. movement of certain functions like in caching, instantiation) reduction in dependencies from domain models API minimisation ...

should a Service layer be a Spring bean?

Can or should a Service layer be a Spring bean? If so, how should it be got from a calling application, a consumer of a service? Because the consumer must be aware that such a bean exists, so it in any case must use Spring to make use of Service methods. ...

The Purpose of a Service Layer and ASP.NET MVC 2

In an effort to understand MVC 2 and attempt to get my company to adopt it as a viable platform for future development, I have been doing a lot of reading lately. Having worked with ASP.NET pretty exclusively for the past few years, I had some catching up to do. Currently, I understand the repository pattern, models, controllers, data ...

MVC, Service Layer and file upload/storage

Hello, I'm a using a layered architecture with Zend Framework. I have MVC with : Controllers > (DTOs) Services (Service Layer) > (DOs) Repositories > Persistance Now i have to handle image galleries. The upload process is handle by the front, but what part is responsible for the thumbs generation ? Do i have to store pictures to a ...

Responsibilities of Service and Repository layers

Just trying to get my head round the responsibilities of the service layer and repository layer when saving an object to my persistence store. My current under standing is this: In my controller I have created a "Note" object from the data submitted by the user (from the form). The user then calls "Save" on the "NoteService" (which is ...

ASP.NET how to implement IServiceLayer

I'm trying to follow the tutorial found here to implement a service layer in my MVC application. What I can't figure out is how to wire it all up. here's what I have so far. IUserRepository.vb Namespace Data Public Interface IUserRepository Sub AddUser(ByVal openid As String) Sub UpdateUser(ByVal id As Integer, By...

[hibernate - jpa ] good practices and bad practices

Hi all, i have some questions about interaction with hibernate. openSession or getCurrentSession (without jta, thread insted)? How mix session operations with swing gui? Is good have something like this in a javabean class? public void actionPerformed(ActionEvent event) { // session code } Can i add methods to my entities that c...

Using Grails without an user interface

I'm thinking about possible alternatives for our EJB based service layer and wondered if it would make sense to use just the service and database layer of Grails together with the Remoting Plugin or is this using a sledgehammer to crack a nut? Speaking of the Remoting Plugin: is there a standard way of generating a JAR file, that conta...

ASP.NET MVC (MVC2) Best practices when Inserting/Updating Data using Linq to SQL and Repository layers

I'm in a bit of a conundrum here and I'm hoping for some of you Guru's to help fill in the blanks. The situation I'm currently facing is with regards to my "Users" table and my "OpenID" table. My app allows for a user to have multiple OpenID's, so I keep track of them in a separate table. Users ID Username OpenID ID Us...

Convert Linq To Sql with JOIN to IQueryable select.

I have a function called GetUserByOpenId I don't want to be using this function at all Public Function GetUserByOpenID(ByVal claimedidentifier As String) As User Implements IUserRepository.GetUserByOpenID Dim user = (From u In dc.Users Join o In dc.OpenIDs On u.ID Equals o.UserID Where...

Question about ASP.NET MVC 2 Custom ViewModels

In my project I have my Linq To SQL dbml file, A Repository Layer for each DB Table and a Service Layer for each Repository. In my service I have some MetaData for Validation as well as I extend each (table) Class to add some custom information to the object (you'll see this in the code below). My question is, Should I consider buildin...

Where to throw an exception in layered architecture?

I've an application that offers its Business Layer through a Service Layer developed with WCF. What I'm thinking about is: this service layer offers operational method like Create, Update and so on. These operation then reroute these calls to the Business Layer. The question is: suppose that one of these call doesn't accept a null input ...

What is the 'best way' or 'best practise' for communicating errors to the View from a service layer in MVC2?

I had issued with using a ModelStateWrapper in MVC 1 as described here: http://www.asp.net/mvc/tutorials/validating-with-a-service-layer--cs As much as I was able to test my application it still felt like there was a dependency/circular reference with the ModelState, the controller and the service layer. With the new DataAnnotation in M...

Updating a Model in asp.net mvc

Our project manager has asked us to refactor an app that was using the Repository Pattern (it was done using Nerddinner as example) to now use a service Layer. My problem now is that Im not sure how to Update a Model cause the UpdateModel method is supposed to be used in the controller... whats a recomended approach to updating a model u...

Performance impact of having a data access layer/service layer?

I need to design a system which has these basic components: A Webserver which will be getting ~100 requests/sec. The webserver only needs to dump data into raw data repository. Raw data repository which has a single table which gets 100 rows/s from the webserver. A raw data processing unit (Simple processing, not much. Removing invalid...

Am I using service layer correctly?

Hi, I have been reading up on DDD and I think I may be using services wrong or at least in a not so ideal way. My service classes tend to have quite a few instance variables containing repository references and they seem to do a lot of work (i.e have a lot of methods). Is it advisable to create more focused services? Like one method per...

How do I inject access control into a service layer of mvc application?

I'm coding a zend framework application using the the standard mvc paradigm with an added service layer to take care of application/business logic. It seems quite popular to put your access control into your services, rather than your modules/controllers/actions, however, I have only seen simple examples with static roles and permissions...

Aggregates, Repositories and a service layer

Take a class which has relations with a couple of other classes. The first class can be seen as the aggregate(root). Seen from the point of the service layer how would one best split the calls? Call the repository of the aggregate for the entire object graph and call from that particular repository other repositories to handle the savi...

Advice With Repository/Service Layer Design Pattern

Hi Guys, Trying to make a really simple repository and service layer pattern here. (.NET 4, C#, LINQ, although this question is partially language-agnostic). Note: this is just R&D. My goal is to minimize the amount of method definitions in my service layer. Here's my Repository Contract: interface IFooRepository { IEnumerable<Foo...