TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chrishornberger
NA
277
0
Some design chit-chat.
Sep 26 2003 10:44 AM
Let me just talk this out a minute. Maybe I'll find answer I like just "talking it out" or maybe one of you fine folks will show me an epiphany. So, I'm writing this library to do HTTPS GETs and POSTs to transfer data back and forth. Once the company FINALLY got me the proper api docs and I was able to see that the URLs they gave me via email were way off the mark, I got the whole basis working. Now I have this "main class" that I call the
Interactor (which incidently follows an established interface and plugs into a Job Framework I've deployed) and it's responsible for creating specific HttpWebRequest and HttpWebResponse objects and doing all the basics. It's all working fine. Now I've created an enum for the basic commands... the common stuff... to tell it whether it's fetching a file listing, it's about to fetch a specific file, post data, etc. Like so: (the array uses the enum entity as its index) private static string[] pCommands = { "/bp/api/getMOD?", "/bp/api/fileListing?dirType=client", "/bp/api/tocListing?", "/bp/api/getFile?", "/bp/api/uploadFile?", "/bp/api/getReport?" }; public enum BearCommand{ GetMOD = 0, GetFileListing = 1, GetTOCListing = 2, GetFile = 3, UploadFile = 4, GetReport = 5 } Now let's say you had to provide url parameters in typical url fasion (someparm=somevalue&someotherparm=someothervalue&andso_on=andso_on). Would you simply require the client to know what it's asking for, or would you typify and objectify them in say... a series of classes that inherit from something like: public interface IOption{ string key{get;set;} string val{get;set;} } and require that your function call also allow for something like (IOption[] options) or just use a hashtable (perfect for key/value pair storage) or would you do something else? I'm tossed as to what to do.
Reply
Answers (
2
)
Metaclass
Having a Problem starting an Application from a Service