473,796 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Good layered architecture with validation and LINQ (+ WCF?)

Does anybody have a good example/guide for using LINQ in a layered
architecture with maybe WCF?

Thanks in advance,

Evert
Feb 3 '08 #1
9 2559
Evert wrote:
Does anybody have a good example/guide for using LINQ in a layered
architecture with maybe WCF?
It's in general not good practise to use a service as a tier. Services
are standalone applications, so should be seen as vertical slices of
your application, not horizontal slices of your application.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 4 '08 #2
Can you explain me why a service is not a Tier? What do you mean with
horizontal and vertical? is there a good site which explains this?

Thanks in advance,

Evert

"Frans Bouma [C# MVP]" wrote:
Evert wrote:
Does anybody have a good example/guide for using LINQ in a layered
architecture with maybe WCF?

It's in general not good practise to use a service as a tier. Services
are standalone applications, so should be seen as vertical slices of
your application, not horizontal slices of your application.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 4 '08 #3
It's in general not good practise to use a service as a tier.
Surely WCF is precicely that though; an abstract bridge between
(generally physical/horizontal) tiers For instance, a smart-client
using WCF to access data from a WCF service over (typically) http[s].
Perfectly normal and indeed the textbook use-case.

For specific scenarios, this does exist - but in quite controlled
scenarios - google for "LINQ to Amazon" for example; not WCF, but a
similar fundamental principle - but it takes a lot of plumbing code.
http://weblogs.asp.net/fmarguerie/ar...to-Amazon.aspx

In the more general sense, I know what the OP is asking for (something
akin to a data-context for a WCF interface), and unfortunately I
haven't seen anything that really fills that gap - but the biggest
barrier is that LINQ really works within a logical (vertical) tier
where you can just about get away with allowing ad-hoc (i.e. not
formally defined up-front) queries, since you are in the same column.
It doesn't work well accross physical (horizontal) tiers, where you
normally want to have well-defined interfaces. That said, the REST
offering in 3.5 may offer some interesting possibilities, since that
is a bit less formalised (allow for better composability); but a
double edged sword...

Marc
Feb 5 '08 #4
Evert wrote:
Can you explain me why a service is not a Tier? What do you mean with
horizontal and vertical? is there a good site which explains this?
Vertical means that you have a full application with layers which has
an interface you can utilize as a service. Horizontal means that you
have a layer in your application which happens to be consumable as a
service.

The downside of horizontal usage of a service is that you have a lot
of data-traffic between tiers in formats which are used internally in
your application. In short: it's very inefficient.

Services should be seen as standalone applications you're utilizing in
your application. See these presentations by Gregor Hohpe:
http://www.infoq.com/presentations/h...oa-development
and
http://www.infoq.com/presentations/h...-conversations

I'm sure after the first one, you'll understand what I mean :)

FB

>
Thanks in advance,

Evert

"Frans Bouma [C# MVP]" wrote:
Evert wrote:
Does anybody have a good example/guide for using LINQ in a
layered architecture with maybe WCF?
It's in general not good practise to use a service as a tier.
Services are standalone applications, so should be seen as vertical
slices of your application, not horizontal slices of your
application.
--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 5 '08 #5
Marc Gravell wrote:
It's in general not good practise to use a service as a tier.
Surely WCF is precicely that though; an abstract bridge between
(generally physical/horizontal) tiers For instance, a smart-client
using WCF to access data from a WCF service over (typically) http[s].
Perfectly normal and indeed the textbook use-case.
'tier' in general means horizontal layer, not vertical pillar.

See my links in the other post :)

FB
--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 5 '08 #6
Services should be seen as standalone applications you're utilizing
in
your application. See these presentations by Gregor Hohpe:
[links to some SOA presentations]
Now, if only we (at large) could agree on a single interpretation of
SOA ;-p
Feb 5 '08 #7
hence horizontal not vertical.
or do I mean vertical not horizontal?
"things that are arranged vertically, and have the same horizontal
reference"

I'm managing to confuse all 3 of us now... more coffee...

But if you can see past my random word swaps, I think I have a
sensible point in there somewhere... probably well hidden...
Feb 5 '08 #8
Marc Gravell wrote:
Services should be seen as standalone applications you're utilizing
in your application. See these presentations by Gregor Hohpe:
[links to some SOA presentations]

Now, if only we (at large) could agree on a single interpretation of
SOA ;-p
Hehe, that would indeed be a first ;). Just imagine if such an
agreement would arise... how many book publishers would go out of
business, eh? ;)

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 6 '08 #9
Just to add a thought; perhaps Astoria is the answer here? Currently
CTP, but it seems to offer much of what you are talking about...? I
haven't had time to play with it yet, though...

Marc
Feb 6 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1370
by: Vin | last post by:
Hi, I've got a VB.Net + ASP.Net message board application which has already been customized. There are two solutions in this application. 1. The front end aspx, aspx.vb files, User controls solution 2. A components solution which has .vb files which have the code to call inserts, updates, deletes to the database (SQL server 2000) Its much like the available general ASP.Net message board. Only a bit customized. Right now a simple...
6
1367
by: Michael Rodriguez | last post by:
If you're using a standard 3-tiered architecture, i.e. Data Layer-> Business Layer->Presentation Layer, where is the recommended place to put data validations? Specifically, data validations such as "Please enter a name." It seems like the best place to put them, from the programmer's point of view, is in the business layer. That way the same validations work for either Winforms or Webforms. Also, if I redo my interface later, I don't...
7
4588
by: Jon Davis | last post by:
I have a couple questions. First of all, would anyone consider a multi-layered programming approach (building business objects that are seperate from data access logic and seperate from user interface logic but that interface the UI and the data) an n-tier implementation by definition? Or does n-tier necessitate a network-distributed architecture (beyond IIS and SQL Server, i.e. COM+/MTS/MSMQ/WCF) in addition to the layered programming? If...
1
1489
by: Pugi! | last post by:
Because my functions tend to become rather lengthy I split up the functions for each subject or action in a function (a) that checks user input (filter and validation) and if this checks out ok it passes the variables to another function (b) that retrieves or stores the data from/in the database, function (a) then communicates the result (true, false, error, list with data) to the client. Currently I organized all functions per subject...
0
1370
by: =?Utf-8?B?RXZlcnQ=?= | last post by:
Does anybody know if it is possible to use the Validation Application Block from Enterprise Library 3.1 in Linq. The problem is that I don't know how to add the validation attributes to the generated properties. Thanks in advance, Evert
8
8949
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then throws up the following error in the browser: CS1061: 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Web' and no extension method 'Web' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found...
1
2039
by: DS | last post by:
I'm trying to understand how these two concepts could work together architecturally (if they can.) I realize both concepts provide benefits of re-use and ease of maintenance. Which is important when you are setting up multiple sites that are similar. But it seems like using both Design Patterns and Layered Architecture together would create conflicts -- especially in the area of keeping layers loosely coupled (and even physically on...
1
1376
by: mimranp | last post by:
Hi all i m using visual developer 2008 i m using xhtml1.1 in that .i m reciving so much error when check in online input w3 standard(C# language code behind) <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Listing.aspx.cs" Inherits="Admin_Category_Listing" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>...
9
2368
by: Shreyas | last post by:
Sorry if this has been asked before. Does anyone know of any modern examples of open source software implemented in ANSI-C using a truly layered architecture (preferably in an OO fashion)? I'd like to get a feel for what the industry best practices are in ANSI-C these days. I'm reasonably experienced in C but I don't have much experience writing layered code in it. I've mainly been using structural decomposition for most of my...
0
10456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.