410 likes | 503 Views
Developing browser based applications [SysReader Programmers Festival ‘97]. T.N.C.Venkata Rangan Vishwak Associates Chennai - 600 033 www: http://www.easytools.com email: vishwak@md2.vsnl.net.in Phone: 489 9109. Conventional Front Ends. Powersoft PowerBuilder Oracle forms
E N D
Developing browser based applications [SysReader Programmers Festival ‘97] T.N.C.Venkata Rangan Vishwak Associates Chennai - 600 033 www: http://www.easytools.com email: vishwak@md2.vsnl.net.in Phone: 489 9109 http://www.easytools.com/festival.zip
Conventional Front Ends • Powersoft PowerBuilder • Oracle forms • Microsoft Visual Basic • Borland dBase/Microsoft Foxpro • CA-Clipper • C/C++ • Borland Delphi http://www.easytools.com/festival.zip
Conventional … Advantages • Familiarity and Experience with them • Reliability • Connectivity (with backend databases) http://www.easytools.com/festival.zip
Conventional … Disadvantages • Portability problems • Compatibility problems • Distribution & Installation • Support and TroubleShooting • Complexity to Developers • Inconsistent UI between various Apps. • Restricted navigation for the user • Security on different Modules http://www.easytools.com/festival.zip
Browser based Apps? HTML based Forms + Client/Server Side Programming + Database Source/Server = Browser based Applications http://www.easytools.com/festival.zip
Browser ... Advantages • Consistent UI between different Applications • Familiar browser paradigm of navigation • Internet/Web Standards • Installation • Browsers are inexpensive and some are free http://www.easytools.com/festival.zip
HTML - An Example <HTML> <HEAD> <TITLE>Welcome</TITLE> </HEAD> <BODY> Hello World! </BODY> </HTML> http://www.easytools.com/festival.zip
Client Side Programming The ACTIVE way [Can I say that as the Microsoft way? :-)] ActiveX Controls (.ocx) ActiveX Documents (.vbd) The JAVA Way [Is it the Programming Nirvana? :-)] http://www.easytools.com/festival.zip
What is ActiveX … ??? ActiveX is basically a specification for interfaces between objects. ActiveX Controls makes up the components used to build other applications, whereas ActiveX Documents is the program. ActiveX Documents may be loosely called as a sophisticated Form Object. You don’t, for example, put a bunch of ActiveX Documents on a form, as you do ActiveX controls on it. http://www.easytools.com/festival.zip
Tools to build ActiveX ... • Microsoft Visual Basic 5.0 • Microsoft Visual C++ 4.x or above • Microsoft Visual J++ • Borland Delphi 3.x Tip:VB 5.0 can directly convert your VB 4.0+ forms into ActiveX controls. http://www.easytools.com/festival.zip
ActiveX - Will it run in ...? • ActiveX is supported in IE 3.0 and above • Runs in Navigator 3.x and above provided you have NCompass labs Plug-in installed:-( • Note: • If the ActiveX control or document is developed in VB/VC++/VJ++ you require the respective supporting libraries/DLLs/VM. • ActiveX controls are Auto downloadable ! :-) http://www.easytools.com/festival.zip
Sample HTML with ActiveX <HTML> <HEAD><TITLE>VB Form into ActiveX Control inside browser </TITLE></HEAD> <BODY> <OBJECT ID="UserControl11" WIDTH=557 HEIGHT=442 CLASSID="CLSID:1DDBB7E7-62BB-11D1-AA70-008048FD3FDA"> <PARAM NAME="_ExtentX" VALUE="11790"> <PARAM NAME="_ExtentY" VALUE="9335"> </OBJECT> <H2> I have my VB 5.0 form as an ActiveX control inside IE 4.0 now.</H2> </BODY> </HTML> http://www.easytools.com/festival.zip
JAVA JAVA: A simple, object-oriented, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multi-threaded, and dynamic language. A JAVA Applet is a JAVA program that adheres to a set of conventions that allows it to run within a JAVA-compatible browser. http://www.easytools.com/festival.zip
JAVA - Sample <HTML> <HEAD><TITLE>A Simple Program</TITLE></HEAD> <BODY> Here is the output of my program: <APPLET CODE=“HelloWorld.class” WIDTH=150 HEIGHT=25> </APPLET> </BODY> </HTML> http://www.easytools.com/festival.zip
JAVA - Sample Applet import java.applet.Applet; import java.awt.Graphics; public class HelloWorld extends Applet { public void paint(Graphics g) { g.drawString("Hello world!", 50, 25); } } HelloWorld.java http://www.easytools.com/festival.zip
JAVA - Sample Applet http://www.easytools.com/festival.zip
Client Side… Advantages • Easier conversion • Server load is reduced • Interactivity • Reduced Network traffic http://www.easytools.com/festival.zip
Client Side … Disadvantages • Code is visible to users • Limited Portability • Restricted Browser independence • Requires powerful clients http://www.easytools.com/festival.zip
Server Side Programming • Active Server Pages (ASP) • PERL and other CGI tools • Microsoft ISAPI & Netscape NSAPI • JAVA Servers from Sun & Netscape http://www.easytools.com/festival.zip
Server Side Programming http://www.easytools.com/festival.zip
ASP - An Example <HTML> <HEAD> <TITLE>ASP Example</TITLE> </HEAD> <BODY> <% for i=1 to 7 %> <FONT SIZE=<%=i%>>Hello World!</FONT><BR> <% Next %> </BODY> </HTML> http://www.easytools.com/festival.zip
ASP - An Example http://www.easytools.com/festival.zip
ASP - An Example <HTML> <HEAD> <TITLE>ASP Example</TITLE> </HEAD> <BODY> <FONT SIZE=4>Hello World!</FONT><BR> <FONT SIZE=5>Hello World!</FONT><BR> <FONT SIZE=6>Hello World!</FONT><BR> <FONT SIZE=7>Hello World!</FONT><BR> </BODY> </HTML> http://www.easytools.com/festival.zip
Form Processing - HTML (eating.html) <HTML><HEAD><TITLE>Sample Form</TITLE></HEAD> <BODY><CENTER><H1>Late-night programmers eating habits</H1> Check all that apply<P> <TABLE><TR><TD ALIGN=LEFT> <FORM ACTION=”eating.asp" METHOD=POST TARGET="_top"> <INPUT TYPE="CHECKBOX" NAME="chk" value="Pizza">Pizza<BR> <INPUT TYPE="CHECKBOX" NAME="chk" value="Coffee">Coffee<BR> <INPUT TYPE="CHECKBOX" NAME="chk" value="Chips">Chips<P> <INPUT TYPE=SUBMIT VALUE="Submit"> </FORM> </TD></TR></TABLE> </CENTER></BODY></HTML> http://www.easytools.com/festival.zip
Form Processing - HTML (eating.html) http://www.easytools.com/festival.zip
Form Processing - ASP (eating.asp) <HTML> <HEAD> <TITLE>Sample Form Processing</TITLE> </HEAD> <BODY> <CENTER> <H1>Late-night programmers eating habits</H1> Your choices<P> </CENTER> <B>You like:</B><BR><%=Request("chk")%><BR> </BODY> </HTML> http://www.easytools.com/festival.zip
Form Processing - ASP (eating.asp) http://www.easytools.com/festival.zip
ADO Sample Code <HTML> <HEAD><TITLE>Project list</TITLE></HEAD> <BODY> <% '----- Open the database, create the record set Set cn = Server.CreateObject ("ADODB.Connection") cn.Open "dsn=ProjList;database=ProjInfo;uid=;pwd=;" Set rs = cn.Execute ("select ProjName, ProjMgr, DueDate from Projects order by DueDate") http://www.easytools.com/festival.zip
ADO Sample Code Response.Write ("<CENTER><TABLE>") '----- Captions Response.Write ("<TR>") for iCol = 0 to rs.Fields.Count - 1' Response.Write ("<TD><CENTER>") Response.Write (rs(iCol).Name) Response.Write ("</CENTER></TD>") next Response.Write ("</TR>") http://www.easytools.com/festival.zip
ADO Sample Code '----- Data rows do while not rs.eof Response.Write ("<TR>") for iCol = 0 to rs.Fields.Count - 1 Response.Write ("<TD>") Response.Write (rs(iCol)) Response.Write ("</TD>") next Response.Write ("</TR>") rs.MoveNext loop http://www.easytools.com/festival.zip
ADO Sample Code Response.Write ("</TABLE></CENTER>") rs.Close cn.Close %> </BODY> </HTML> http://www.easytools.com/festival.zip
ADO Sample Code http://www.easytools.com/festival.zip
PERL PERL stands for Practical Extraction and Report Language. Larry Wall (creator of PERL) loves to call it Pathologically Eclectic Rubbish Lister http://www.easytools.com/festival.zip
PERL - Advantages • FREE of cost • Popularity • Available for many platforms • Socket Support • Pattern Matching (ideal for searching text) • Flexible Text handling (No details to worry) • Newer packages for Win32 support ODBC http://www.easytools.com/festival.zip
PERL - Sample sub getFormData { my($buffer) = ""; if ($ENV{'REQUEST_METHOD'} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; } else { read(STDIN, $buffer,$ENV{'CONTENT_LENGTH'}); } } http://www.easytools.com/festival.zip
Server Side… Advantages • Instant Portability-Platform Independence • No manual installation • Easy/Auto Distribution (upgrades too) • Scalability • Runs in thin clients • Data + Code resides only in the Server • Code (Core business logics) are secure • No need of seperate S/W client licenses • No compilation process for ASP & PERL http://www.easytools.com/festival.zip
Server Side… Disadvantages • Learning curve (because of New tools) • Server is overloaded? • Server licenses are expensive • Speed (both ASP & PERL are interpreted) http://www.easytools.com/festival.zip
Decision ? Develop. Ease of development not only means that an application can cost less to develop, it means that the team's skills can be better utilized. Scale. It is possible to build a single application that can be used by virtually any number of users—simultaneously. Maintain. Customer requirements change, businesses change, business needs change and will continue to change while the team adapts existing systems to last week's changes. Deploy. Systems should be easy to install and should easily be upgraded to the newer versions. Use. The application must not only work responsively, it must anticipate user needs, http://www.easytools.com/festival.zip
Reference Books • Programming PERL - Larry Wall • HTML The definitive guide - Musciano & Kennedy • JavaScript Programming - Reaz Hoque • Understanding ActiveX & OLE - David Chappell • Active Visual Basic 5.0 - Eddon & Eddon • The JAVA Tutorial - Campione & Walrath • Unlocking Active Server Pages - Christoph Wille http://www.easytools.com/festival.zip
World Wide Web • www.perl.org • www.activestate.com • www.w3c.org • developer.netscape.com • www.javasoft.com • www.microsoft.com/iis/default.asp • www.microsoft.com/iis/evaluating/guides /whitepapers/aspwp.htm • www.microsoft.com/msdn http://www.easytools.com/festival.zip