Re: newbie question on cobol syntax




"LX-i" <lxi0007@xxxxxxxxxxxx> wrote in message
news:8-qdnQ6YAf0SPa_bnZ2dnUVZ_sWdnZ2d@xxxxxxxxxxxxxx
Pete Dashwood wrote:
"LX-i" <lxi0007@xxxxxxxxxxxx> wrote in message
So far, it hadn't happened. Of course, I'm just starting to get into
the meat of it. Between Java and C#, though, I'd have to say I prefer
C#'s syntax, especially when it comes to properties.

Yes, me too. I hardly use Java these days.

I'm actually feeling a bit better about it today - I'm actually
understanding how its put together. This project is also my first
experience with CVS - three of us have been working on pretty much the
same files for the past two days. We just just have to make sure we
update before we commit, so we don't introduce conflicts.

I am currently grappling with remote web services for my new product web
[snip]
Anyway, the man who runs the host I'm using is a very experienced .NET/C#
guy and he sent me a C# solution in minutes, that does exactly what I
need and was about 10 lines of code. Every day I learn something
more...:-)

What did it do?


It allows me to test any webservice that is exposed anywhere, even though I
am not running on that host. (The Web Service template used by VS 2005
allows this, but only if you are running on the host where the service
resides. It is really useful and, during development on IIS I came to rely
on it quite a bit. Once I posted services to a host, I could no longer do
this and it was a an irritation.) The main Web Service I have written has a
COBOL COM component at the heart of it, wrapped in C#, and it is reassuring
to be able to check that the component is running, from a Browser, before
trying to access the service under program control. Whern I saw his C# code
I immediately thought "Why didn't I think of that ?!" My experience has been
that whenever this happens, I learn something... :-)

Here's the code...

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
AVSProxy.AVSWebService proxy = new AVSProxy.AVSWebService();
Label2.Text = proxy.ValidateNZaddress(TextBox1.Text);
}
}

(This is running the "ValidateNZaddress" method of an exposed web service
called "AVSWebService"; it could be easily modified to run any method of any
exposed service...)

....and here's the ASPX page it runs from...

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Enter Address to
test:"></asp:Label><br />
<asp:TextBox ID="TextBox1" runat="server" Height="148px"
TextMode="MultiLine"
Width="357px"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Test"
OnClick="Button1_Click" />
<br />
<br />
<asp:Label ID="Label2" runat="server"
Text="Label"></asp:Label></div>
</form>
</body>
</html>

Obviously, there are a few support objects (like a proxy to my web service)
generated by VS 2005, but the above is enough to give you the idea.

If anybody reading this has the same problem, I'll gladly forward the
package by private mail, (but you must include references to your own web
services (not mine... ;-)) when you build it ).



Our system uses Apache, Struts, and Velocity, along with Java and
Oracle.

Yes, I remember some of my Java people getting excited about Struts. I'm not
sure what this is... I'm unfamiliar with Velocity, too.

They also loved AJAX which I have as next on my list :-) (now it is
available for C#)... I just haven't time to do the education I need to,
until this web site is published, but after that I expect to relax and
immerse myself in some of this "new-fangled high tech mumbo-jumbo"... :-)

Funny... I'm so busy doing stuff, I don't have time to learn it... :-)

I'm sure many here have been in that situation...


I like the way it's laid out, but there are a lot of different pieces in
different places. I'm beginning to understand MVC, but it seems that C#
is a little more straightforward in that as well.

I like the "simplicity" of C#. I think straightforward is a good word...

Well, it fits nicely. Model = database or objects, View = ASP.net page,
Controller = code-behind file. In our environment, Model = database or
objects, View = Velocity template, Controller = Struts action. Of course,
for each object you've got to have a service, then for each template you
have to define the fields in the struts config file, the the labels are in
an ApplicationResources.properties file... !!!

I guess that's all the stuff that happens behind the scenes when you say
"AutoEventWireup=true"... :)

Yep, see code above... :-)


So there's hope for me yet - cool! (Of course, this will probably be my
last "hands in the code" assignment, especially if I make E-7. That'll
put me into management at that point.)

Shhhh!!! Don't tell Doc.... :-)

You know he wakes up when someone uses his name... ;)

The other day, we were talking about something new that the customer
wanted. They didn't think we could do it in a month, so I said, "Well, is
there a central, essential piece that we could build, along with an
infrastructure that would support the future requirements?"

One of the developers looked at me and said "Man - you sound like a
project manager!"

Ah, so this developer is used to Project Managers with a positive, can-do,
attitude...excellent!


(As it turns out, it's not nearly as complex as we
though, so we can give them the essentials plus an assortment of bells and
whistles in this first iteration - sweet!)

The first step to becoming legend... deliver more than they expect.

Pete.


.