4/13/09
Building Saas application in .NET
Take advantage of ASP.NET single sign-on
If your application is going to be comparmentalized into multiple sections, consider using third domain (sub-domain) such that you have
http://foo.myapp.com
http://bar.myapp.com
then make sure to enable cross-sub-domain SSO by writing the ASP.NET forms authentication cookie against "myapp.com" domain (as against a specific sub-domain such as "foo.myapp.com" or "bar.myapp.com"). This provides extension points for additional ASP.NET web applications while using the same login sessions.
Consider using third-party single sign-on integrations
Try not to build your own identify server. That is: do not implement your own "login" page that takes password that you manage. You want to stay away from that. Instead, use external identity servers including Windows Live!, Yahoo BBAuth, OpenID, etc. This is a win-win for developers as well as users.
Use XML schema-driven business objects
After many tries with different approaches, I am convinced that using XML Schema (XSD) with tool generated C# wrapper is the best way to capture business objects. For any new web application, I create a folder called "Entities", and I create three files:
mybusinessobjects.xsd
mybusinessobjects.cs
generate.bat
mybusinessobjects.xsd will contain all of the data type definitions of the application's business objects. For example, if your application is about student enrollment process, then you will define Studen, Course, Semester, etc. in this XML schema.
mybusinessobjects.cs is not manually created but created by running XSD.exe tool, that takes XML schema file and produces a C# class definitions. generate.bat is for running XSD.exe and it looks like this
xsd.exe mybusinessobjects.xsd /n:MyApp.Entities
By executing this line, you will easily get C# object representations of all of the things you defined in mybusinessobjects.xsd, placed in the namespace, "MyApp.Entities"
These tool-generated C# classes are in-memory "storage" for your business objects, and they can be serialized to XML (and deserialized from XML) very easily.
This serializability between XML and C# is very convenient and flexible. For example, you can write UI that takes C# object model and set it to DataSource of ASP.NET Repeater control. Or, you can deserialize it to XML and pass it through XSLT to produce another XML, which can be consumed by an existing code. It opens up possibilities to working with your business objects.
Use XML to communicate with Database
After many attempts to use DataSet in ADO.NET, I am settled with this approach. The idea is to use very stable stored procedure interface, and use XML as input and output parameters, and all variations are captured in XML input/output. For example, many of the stored procedures have the same signature of:
sp_foo(userId, languageId, xml)
which returns string (which is xml output)
Note: there will be some stored procedures that must deviate from this pattern
With this interface, you can easily build Data Access layer that can be used by Business Logic layer to update data and retrive data to/from database.
The stored procedure has to be written such that it can take incoming XML and parse it to obtain necessary inputs for the procedure, and be able to form XML output. (Luckly, DBA I work with is very good at this that I don't need to know how its done exactly...)
Use SQL Data Services
This is another approach for solving data storage needs for a SaaS application. Instead of your maintaining database for your self, completely offload that task to cloud computing. Though I have not used it for commercial development project, I am convinced that SQL Data Services provides sufficient data storage capabilities to web-based application. The benefit is clear: you do not need to maintain your own database tier in your data center (and if you use Azure, where you host your ASP.NET application, then you don't need data center all together!); you pay as much as you use so it is cost-effective.
Use YUI (Yahoo! UI) for your page development
I have used YUI for both work and hobby and works great. It gives you browser neutrality right from the beginning. Let these experts at Yahoo! to solve browser compatibility issues and just focus on solving your own problem. YUI can be a bit tricky to use in ASP.NET, but many of the components in YUI can be used easily in simpler cases.
Use HttpHandler for AJAX server
It is possible, and often done, to use regular ASP.NET pages (.aspx) to implement server-side logic that returns XML (or JSON) output to a client-side script. Howerver, it makes more sense to implement such server-side logic using HttpHandler, which is more efficient than ASP.NET pages, and fits well with the model of "client script (UI) - server logic (BLL)". Essentially, client script is acting as user interface, and if you follow strict sepration of UI and Logic, then your server-side logic should not have anything to do with UI, such as page controls. HttpHandler is nothing but an end-point responding to an Http request, where returned output may not necessarily HTML but XML, JSAN, image, document, etc.
Enable Google Analytics right away
No further discussion on this. Just do it.
Pay attentions to security from the beginning
With web application, you want to start with "locked" down application instead of you lock it down as you go by. Read up "cross-side scripting" and "SQL injection" first and make sure we have no holes for that. Compile a list of Query string being passed around, Cookies saved to the user's machines, input fields that user can type in, and make sure each item is being evaluated to ensure that these cannot be exploited.
Build exception and error handling infrastructure
First thing you have to do is to define "application exceptions" at your Business Logic layer. Any Business Logic has an error condition that is created because of "user". For example, with Student Enrollment application, if one of the business rules states that "You cannot sign up for a class unless pre-requisites are completed", then you have an exception. Yes, UI can try to make sure that it will never be in such condidtion, but who knows? Business logic layer should NOT rely on UI does good job and never create such situation. Instead, Business Logic should throw "application error".
This is one of the most important use of Exception handling. You will define your own "application exception" that can be presented to the user and "user" can modify his/her behavior to fix the issue. This is in contrast to "system exception" where it is due to system error and not user. For example, if disk space run out and causes IO exception, user can do absolutely nothing to remedy that.
So, you deal with two large groups of exceptions: Application Exception and System Exception. Now, how do you handle them and where? The answer is: at each page, look at method that make call to Business Logic layer and wrap it around with try block, then create one catch block to handle application exception, and anthor one for system exception. The way you handle two kinds of exception is different: for application exception, tell user why and what user should to do avoid receiving the same exception (example: show message like "You are not allowed to enroll this course because you have not completed HIS101"). In contrast, for system exceptions you want to show something like "A system error encountered. The error has been reported to system administrator. If this problem continues, please contact xxx-xxxx. Error Code: 2231".
When handling system exception, your catch code must log the error to somewhere (such as text log file or event log). Ideally, you generate a unique Error Code value, and write it to the event log with the detailed error information, and also show it to the end user. This way, when user calls for a help, technical person at our end can locate the related error event log.
Use WF and WCF right from the beginning
There are features in Workflow Foundation and Communication Foundations that let you implement your application features easily and effectively. WF comes with sequential workflow and state machine workflow that models many real-world workflow. For example, "student enrollment" is a perfect example for sequential workflow that takes multiple input values to produce a result (student has sign up, system accept it, schedule bill, etc.)
WCF opens up possibilities to "extentions" such as web-service, REST based API, working with additional back-end engines, etc. The boilerplate code for hand-shaking, security, throttling and bufferin, are all taken care of for you.
Engage users as soon as possible
In another word, engage in Agile software development model. I strongly recommend using User Stories methodology to drive the whole development process. Good applications solve real user problems, and to do so developers need to know what the problems users are facing. Sometimes users don't know how to describe the problems, and/or they may not understand the best way to solve it. The chances are, the application you built today will be ineffective tomorrow and you will have to make constant changes to the application. So, stay small and address core issues first, then present it to the users to see if it is indeed solveing the users problem. Do not waste time working on bells & whistle since users can go without them for a while.
Integrate with Facebook and other social media as much as possible
Consider creating a Facebook application that provides an interface to your web application. At minimum, Facebook app has iFrame mode where you can show your web application interface embedded in Facebook. Of course, if you can integrate more, that would be nice. Facebook is an organic solution delivery mechanism where solical graph drives the distribution of solutions. If your application solves a problem for one Facebook user, then chances are, it will be useful to other Facebook users, and the initial "case" of one user solving his/her problem can proliferate to other users with similar problems. Forget the classic "you come to our website and sign up to get good stuff" model.
That's it for now...
Subscribe to:
Post Comments (Atom)

55 comments:
女性会員様増加につき、当サイトの出張ホストが不足中です。女性の自宅やホテルに出向き、欲望を満たすお手伝いをしてくれる男性アルバイトをただいま募集していますので、興味のある方はTOPページから無料登録をお願いいたします
最近様々なメディアで紹介されている家出掲示板では、全国各地のネットカフェ等を泊り歩いている家出少女のメッセージが多数書き込みされています。彼女たちはお金がないので掲示板で知り合った男性とすぐに遊びに行くようです。あなたも書き込みに返事を返してみませんか
オ○ニーライフのお手伝い、救援部でHな見せたがり女性からエロ写メ、ムービーをゲットしよう!近所の女の子なら実際に合ってHな事ができちゃうかも!?夏で開放的になっている女の子と遊んじゃおう
メル友募集のあそび場「ラブフリー」はみんなの出逢いを応援する全国版の逆援助コミュニティーです!女の子と真剣にお付き合いしたい方も、複数の女性と戯れたい方も今すぐ無料登録からどうぞ
簡単にお小遣い稼ぎをしたい方必見、当サイト逆¥倶楽部では無料登録して女性の性の欲求に応えるだけのアルバイトです。初心者でもすぐに高収入の逆¥交際に興味をもたれた方はTOPページまでどうぞ。
サイト作成は初めてでぇす。プロフは友達も作ってたので私も頑張って作成しました。プロフもってる人はメル友になって見せ合いっこしませんか?メアドのせてるので連絡ください。love-friend0925@docomo.ne.jp
男性が主役の素人ホストでは、女性の体を癒してあげるだけで高額な謝礼がもらえます。欲求不満な人妻や、男性と出逢いが無い女性が当サイトで男性を求めていらっしゃいます。興味のある方はTOPページからどうぞ
あなたのSM度をかんたん診断、SM度チェッカーで隠された性癖をチェック!真面目なあの娘も夜はドS女王様、ツンデレなあの子も実はイジめて欲しい願望があるかも!?コンパや飲み会で盛り上がること間違いなしのおもしろツールでみんなと盛り上がろう
男性なら一人くらいは作ってみたいセフレですが、実は女性もいつでもSEXしたいときにできる友達がほしいと思っているのです。そのような彼女たちの欲求を満たしてあげませんか
女性向け風俗サイトで出張デリバリーホストをしてみませんか?時給2万円の高額アルバイトです。無料登録をしてあとは女性からの呼び出しを待つだけなので、お試し登録も歓迎です。興味をもたれた方は今すぐどうぞ。
SM度チェッカーで隠された性癖をチェック!外見では分からない男女のSM指数をチェックして相性のいい相手を見つけ、SMプレイしてみよう!合コンや飲み会で盛り上がること間違いなしのおもしろツールをみんなとやってみよう
性欲のピークを迎えたセレブ熟女たちは、お金で男性を買うことが多いようです。当、熟女サークルでは全国各地からお金持ちのセレブたちが集まっています。女性から男性への報酬は、 最低15万円からとなっております。興味のある方は一度当サイト案内をご覧ください
プロフ見た感想を携帯アドの方に送ってください。悪口は気が病むので止めておいて欲しいですjewely.jmtjd@docomo.ne.jp
ネットで恋人探しなら、グリーをおすすめします。ここからあなたの理想の恋愛関係がはじまります。純粋な出会いから、割り切ったエッチな出会いまで何でもあります。ミクシーから女の子が大量流入中!ココだけの話、今が狙い目です
当サイトは、みんなの「玉の輿度」をチェックできる性格診断のサイトです。ホントのあなたをズバリ分析しちゃいます!玉の輿度には、期待以上の意外な結果があるかも
セレブラブでは心とカラダに癒しを求めるセレブ女性と会って頂ける男性を募集しています。セレブ女性が集まる当サイトではリッチな彼女たちからの謝礼を保証、安心して男性はお金、女性は体の欲求を満たしていただけます。興味がある方は当サイトトップページからぜひどうぞ
携帯アドのせておきました。恥ずかしい写真とか乗せてるけど、許してください。ネット友達探してるのでよかったら連絡ください。for-a-sweetheart@docomo.ne.jp
ゲイの数が飛躍的に増えている現代、彼らの出逢いの場は雑誌やハッテン場からネットに移り変わってきています。当サイトは日本最大のゲイ男性の交流の場を目指して作られました。おかげさまで会員数も右肩上がりに伸びています。ゲイの方や興味のある方はぜひ当サイトをご覧ください。
家出した少女たちは今晩泊る所がなく、家出掲示板で遊び相手を探しているようです。ご飯をおごってあげたり、家に泊めてあげるだけで彼女たちは体でお礼をしてくれる娘が多いようです
さびしい女性や、欲求不満な素人女性たちを心も体も癒してあげるお仕事をご存じですか?女性宅やホテルに行って依頼主の女性とHしてあげるだけで高額の謝礼を手に入れる事が出来るのです。興味のある方は当サイトTOPページをご覧ください
最近いい事ない人集合!話聞いて欲しいって時ないですか?やけに寂しいんですよね。私も聞くので私のも聞いてください。メアド乗せておくのでメールから始めましょうfull-of-hope@docomo.ne.jp
性欲を持て余し、欲求不満になっている女性を金銭の対価を得て、癒して差し上げるお仕事です。参加にあたり用紙、学歴等は一切問いません。高額アルバイトに興味のある方はぜひどうぞ
グリーで広げよう、掲示板の輪!グリーから飛び出た出会いの掲示板が楽しめるのはここだけ、無料登録するだけで友達・趣味トモ・恋人が探せちゃいます
パーティーや合コンでも使える右脳左脳チェッカー!あなたの頭脳を分析して直観的な右脳派か、理詰めな左脳派か診断出来ます。診断結果には思いがけない発見があるかも!みんなで診断して盛り上がろう
野外露出の掟・・・それはいかに通報されないで脱ぐかですが、合法的に露出プレイを楽しめる方法があるのをご存じですか?当サイトで露出パートナーを探したりプレイ出来る場所を提供を探したり出来るのです。興味のある方はどうぞ
女性会員様増加につき、出張ホストのアルバイトが不足中です。ホテルや女性の自宅に出向き、彼女たちの欲望を満たすお手伝いをしてくれる男性アルバイトをただいま募集しております。興味のある方はTOPページをご覧ください
美容院いってきた記念に写メを更新しました。結構気に入ってるんですけどどうですか?メール乗せておくのでメッセお待ちしてるなりmiracle.memory@docomo.ne.jp
最近雑誌やTVで紹介されている家出掲示板では、全国各地のマンガ喫茶等を泊り歩いている家出少女のメッセージが多数書き込みされています。彼女たちはお金がないので掲示板で知り合った男性の家にでもすぐに遊びに行くようです。あなたも書き込みに返事を返してみませんか
高級チェリーの秋は童貞卒業のシーズンです。童貞を食べたい女性達もウズウズしながら貴方との出会いを待っています。そんなセレブ達に童貞を捧げ、貴方もハッピーライフをってみませんか
童貞を奪ってみたい女性たちは、男性にとって「初体験」という一生に一度だけの、特別なイベントを共に心に刻み込むことを至上の喜びにしているのです。そんな童貞好きな女性たちと最高のSEXをしてみませんか
プロフ作ったわいいけど見てくれる人いなくて少し残念な気分に陥ってます。意見でもいいので見た方がいましたら一言コメント送ってくだしゃいメアドのせているのでよろしくでしゅapotheosis@docomo.ne.jp
乱交パーティー実施サークル、「FREE SEX NET」では人に見られること、人に見せつける事が大好きな男女が集まり、乱交パーティーを楽しむサークルです。参加条件は「乱交が好きな18歳以上の健康な方」です。興味がある方はぜひ当サイトをご覧ください
全国各地の名うての盗撮のプロたちが自身のコレクションを密かに交換する、完全会員制・盗撮掲示板。門外不出のここでしか見られないお宝ばかりです。話題のhaman動画よりヤバイ動画をゲットしよう
あなたの秘められた精神年齢をチェックできる診断サイトです。ここであなたの実際の精神年齢が簡単な質問でわかっちゃいます。普段は子供っぽいあの人も実は大人の思考の持ち主で子供っぽく振舞ってるだけかも知れませんよ
家出している女の子と遊んでみませんか?彼女たちはお金に困っているので、掲示板で知り合ったいろんな男の家を泊り歩いている子も多いのです。そんな子たちとの出逢いの場を提供しています
ネットで恋人探しなら、greeをおすすめします。ここからあなたの理想の恋愛関係が始まります。純粋な出逢いから、割り切ったHな出逢いまで何でもあります。ミクシーから女の子が大量流入中!ココだけの話、今が狙い目です
出会ぃも今は逆¥交際!オンナがオトコを買う時代になりました。当サイトでは逆援希望の女性が男性を自由に選べるシステムを採用しています。経済的に成功を収めた女性ほど金銭面は豊かですが愛に飢えているのです。いますぐTOPページからどうぞ
世界の中心で貴方を叫ぶような恋がしたいんです。愛に飢えているゆいと恋バナ話ませんか?メアドのっけてるので気になる方は連絡頂戴ねuna-cima@docomo.ne.jp
女性向け風俗サイトで出張ホストをしてみませんか?時給2万円以上の高額アルバイトです。無料登録をしてあとは女性からの呼び出しを待つだけでOK、お試し登録も歓迎です。興味をもたれた方は今すぐどうぞ。
流出からハメ撮りまでマニアも満足のエロ動画満載、抜きたくなったらチャットでサックと約束、有無を言わさずサックと中出し、便器女を簡単get出来るサイトです
セレブと言われる世の若妻は男に飢えています、特に地位が邪魔して出会いが意外と少ないから、SEXサークルを通じて日頃のストレス発散に毎日男を買い漁っています。ここは彼女達ご用達の口コミサイトです
一人で家出したんだけど助けてほしいです。今まで強がってました。もう親には頼れない…super-love.smile@docomo.ne.jp
激レア映像!芸能人のお宝映像を一挙公開中!無料登録するだけでレアなお宝映像やハプニング画像が取り放題、期間限定の動画も見逃せない
大人気、動物占いであなたの秘められた野性がわかる!草食系と思っていたあの子も実は肉食動物かも知れない!意外性のある占いをみんなで楽しもう
仕事を辞めてください。一日で今の月収を超えるお誘いがあります。某有名セレブ熟女の強い要望により少しの間、恋人契約という女性からのお申し込みがありました。今までは地位や名誉のために頑張ってこられたようでございますが年齢を重ね、寂しさが強くなってきたようでございます。男性との時間を欲しがっている女性に癒しを与えてくださいませ
エロアニメナビ・エロ漫画好きにはたまらないお宝満載!激アツなサイトだけを選りすぐりました。女の子にも男の子にも使いやすく無料で出会えるサイトばかりを掲載しています
1人Hのお手伝い、救援部でHな見せたがり女性からエロ写メ、ムービーをゲットしよう!近所の女の子なら実際に合ってHな事ができちゃうかも!?開放的な女の子と遊んじゃおう
ストーカーの追い回されて怖いんです。毎日夜になると非通知電話多いし怖い。。。助けてくださいpeach-.-girl@docomo.ne.jp
復活、スタービーチ!日本最大の友達探しサイトがついに復活、進化を遂げた新生スタービーチをやってみませんか?理想のパートナー探しの手助け、合コンパーティー等も随時開催しています。楽しかった頃のスタビを体験しよう
「友達の中で処女なのは私だけ…でも恥ずかしくて処女だなんて言えない、誰でもイイからバージンを貰ってほしい!」そんな女性が沢山いる事をご存じですか?出合いが無かった、家が厳格だった等の理由でHを経験したことがない女性がたくさんいるのです。当サイトはそんな女性たちと男性を引き合わせるサイトです
メアド開運、あなたの使ってるメアドを診断出来ちゃうサイト!吉と出るか凶と出るかはあなた次第、普段使ってるメアドの金運、恋愛運が測定できちゃいます
今話題の逆¥交際!あなたはもう体験しましたか?当サイトでは逆援希望の女性が男性を自由に選べるシステムを採用しています。成功を収めた女性ほど金銭面は豊かですが愛に飢えているのです。いますぐTOPページからどうぞ
只今、シャープ32型液晶テレビ、PS3等、豪華商品が当たるキャンペーンを実施中!まずは欲しい商品を選び、メールアドレスを登録して無料エントリー!その場で当たりが出たら賞品ゲットできます。抽選に外れた方もWチャンスで商品券等が当たります。ぜひチャレンジして下さい
effect of viagra on women viagra free sites computer find free sample prescription for viagra how to get viagra cialis v s viagra how does viagra work buy viagra australian viagra sample can viagra be used by women viagra soft tabs viagra canada suppliers of viagra cheap cheap viagra viagra blood pressure
一夜限りの割り切ったお付き合いで副収入が得られる交際サイトのご案内です。アルバイト感覚での挑戦もできる、安心の無料登録システムを採用しておりますので、興味のある方は当サイトへぜひどうぞ
Post a Comment