Solved

sample CRUD using WCF

Posted on 2007-11-30
6
3,365 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
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…

829 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