Solved

sample CRUD using WCF

Posted on 2007-11-30
6
3,360 Views
Last Modified: 2013-12-16
hi everyone,

im currently about to start a new project which basically is a registration system (for school). In the past i have developed this type of project using n-tier OOP approach. I have recently learned WCF, and im convinced that SOA is the way to go. But all samples that i have read involves only a service with simple methods. I can't seem to find a sample of WCF used in CRUD database operations. I have even read something about anti-pattern when it comes to CRUD. Can someone point me to the right direction? A sample of an n-tier WCF database application or even an article would be of great help. thanks!
0
Comment
Question by:manduz_griffus
  • 3
  • 2
6 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20389589
You won't find many examples about WCF with database operation, because database examples are complex to deploy, and really it is not related with the WCF issue.
Just look for WCF examples and apply your knowledge of database programming, there is no mystery.
0
 

Author Comment

by:manduz_griffus
ID: 20390419
hi jaime olivares,

thanks for your comments. if so, then how am I suppose to add records in a distributed system using WCF? in my point of view, adding a student is a service. what i want to know is am i getting the right impression and if so, something to justify this impression would be very helpful (like an article). due to the anti-pattern that i read, im not sure if CRUD operations are services. if not, how do i add, update, delete, and find records from a client to a service? if yes, please give me a sample. thanks again.
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 125 total points
ID: 20390483
Well, anti-pattern is a vast term, frequently related to an unuseful or harmful practice that appear to be benign.
Adding a studing to a database using a service could be excesive, but if as a part of several tasks related to a student would be perfectly justifiable, specially when more than a single database operation will be involved.
By example, maybe adding a student will imply to add it to the master student table, plus the career/courses table, plus the accounting table. So, the service can provide you a high-level interface (like the client tier) to encapsulate mid-level (business) and low level (data access) tasks.

0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:manduz_griffus
ID: 20390998
thanks, i understand what you mean... one last thought though; your sample makes perfect sense, but what about isolated add/update/delete operations? i mean for example, creating a new course where you can't associate it with any other operations. just merely adding a course. or merely update the name or delete a new course (no relations yet). if you were in this situation, how would you expose an add new course feature? is it okay to expose it as a service, cause i cant think of any possible way to add this course from a client using WCF.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20391060
all operations: add student, add course, remove course, remove student,  should be grouped as a single service.
in your client message, you should specify the kind of operation you desire to do.
0
 

Expert Comment

by:vj_mi
ID: 21563081
Hi manduz_griffus,
Did u manage to get the WCF for CRUD? I would appreciate if I could get your sample source to study and understand as I need the same scenario.

Regards.
MI
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question