Introduce DataBase,Asp.net,JavaScript,Xml,Html,Css,Sql,Php,ASP.NET Controls,AJAX,Tools,HTML,CSS,JavaScript,Open Source Project,WPF,.Net Framework,Linq
Top Recommended Hosting

Need advice - how to design my app

by the3factory 5/10/2008 8:02:00 PM
Question:

I'm new to object oriented design, and I could use some help with a high-level design for a new .NET app. Please give me ideas about how you would organize the following web app into classes:

The purpose of the web app is to use XML to copy down data from a web-based (SaaS) third-party accounting system. We want to copy down the data into our own database, so we can report off of it more easily. The accounting system has data objects (customers, accounts receivable, general ledger, etc). For each data object we will create a corresponding database table and fill it with the data. You get data from the web-based accounting system by sending a request in XML, and the response that contains the data is also in XML.

What classes would you create to implement this application?

I know how to send and receive the XML. What I don't know is how to design this app in an object oriented way, to think in terms of classes - instead of just using global variables in my code-behind and just adding methods there. I have learned about classes (encapsulation, inheritance, etc) and I know how to create them, but I don't know how to do an overall design that uses classes.

Much thanks


Answer1:

Try To Explore about Little bit of REST [as your request and response both are xml based]

 


Answer2:
XML Web Services is the key. Check out Windows Communication Framework (WCF), it may fit perfect to your solutions.

Answer3:

DigiMortal:

Answer4:
Well, you said you need to get data from the other system to your system. SOAP and other XML based data exchange protocols are best option to bet on. WCF is current technology that let's you create web services. The point is simple - you can hide implementation details behind web service. You just get data from it and call the methods that service provides. As I understand your application will be the client application and the other app you are communicationg with is server app. The other app should provide your app with XML based web services, so your app can get data it needs. Also this service may offer methods to manipulate it's data. To get a better technical picture about WCF I suggest you to read article Getting Started Tutorial from MSDN library.

Answer5:

Well you already know how to get XML so I won't go into what technology to use for this as it is irrelevant, so I will stick to just the way I would go about designing the classes, first things first this code should not be in a code behind on an aspx page what if you want to re-use the code for retrieving the XML in another location having this code in a code behind makes this very tricky instead you should have a class library that gets called into by a seperate frontend client (winform, asp.net, console etc..).

Next I would definitely isolate the code that will be making the actual call to the third party and probably have it implement an interface to make it more unit testable something like  

ICustomerDataRetriever
IAccountDataRetriever

That would maybe have something like an RetrieveData method that would return the xml. This has the benefit of being able to test the code that inserts into the database without having a dependency on the code thats performing the retrieval (in case the third party is not available or more likely that the data is not in a predictable state). As for the database insertion if all your doing is inserting data from XML and not performing any business logic you could probably get away with using the standard ADO.NET objects no point in going down the route of using something just because new and shiny when you already have something already available.


Related posts

Sign up for PayPal and start accepting credit card payments instantly.


Powered by BlogEngine.NET 1.2.0.0