Went on a Job Interview today.

  • Thread starter Thread starter Terry Williams
  • Start date Start date
T

Terry Williams

I went on a job interview today... Basically, you've got mainframers
trying to create reports modules in asp.net, and the they need a
programmer with vb.net/asp.net experience.

One of the questions was...

How do you pass data from one form to another, example, you fill out a
webform, then go to the next webform, then the next webform, until
you've reached the end, then process all the data.

They use session variables for everything ? I mainly use session
varibles. So they might end up with 30 or 40 session variables for a
particular report.

I personally pass as much info via the parameters of a URL. and use
session variables for mainly setup parameters, system wide configuration
parameters and storing viewstate.

What's your opinion on this ?


Also, they converting over to DB2, and learning the speed of stored
procs. Nice enough people, though.
 
I use session variables, but be creative too
remember you can store stuff in the database too

Francisco
 
Hey Terry,

Well, I wish you the best of luck with your job interview, I really hope it
works out for you...

As for your question how to handle it, here is what I would do.

Now, your approach of passing everything in the query string is perfectly
acceptable, now a days it is. There are some browsers that have a 255
character limit in the query string, but these are few and far between.

Now, the obvious way to go is to use post variables, agian, perfectly
acceptable, especially in ASP 1.0-3.0.

The downside is security, which can be easily comprimised if your not
careful (well, by an educated person that is... joe blow wont figure it out
probably...) But that is rarely a concern especially in an intranet
environment.

However, your not an ASP 3.0 programmer anymore Terry, your .NET class. And
Microsoft gave you some pretty sweet tools. Now, there is nothing wrong at
all with storing in the session object, I enjoy using it, reduces amount I
put in the viewstate and other places (and variables to keep track of and
where they are at.) So when you have a multi part form for organized series
of data, use a Dataset, and store that dataset in the session object. That
way, your not constantly repopulating things, your only using one area of
the session object, and its all in a nice tight object oriented structure.

Hope it helps and again, best of luck.

-CJ
 
an -in my opinion- nice way is to create one dataObject for each webform
(or even one object containing another object for each webform)

put all this in a few (first choice) or one (second) session vars

this way is it also very easy to move between the webforms and check if the
user already passed on one form to fill in everything as default vars...


Dominique
 
That's what I like about these newsgroups. Especially, Where I might be
strong in a area, but weak in others.

Actually, that's what one of the people said she did, create a dataset
and store it in session. For a mainframer, she done good.

That means if someone else comes up with the same answer as her and you,
CJ. They've got the job. Oh well, back to the soup lines for me...:(
 
Isn't query string to perform queries against databases subject to sql
injection?

Francisco
 
Terry Williams said:
That's what I like about these newsgroups. Especially, Where I might be
strong in a area, but weak in others.

Actually, that's what one of the people said she did, create a dataset
and store it in session. For a mainframer, she done good.

That means if someone else comes up with the same answer as her and you,
CJ. They've got the job. Oh well, back to the soup lines for me...:(

Everyone has there own strengths and weaknesses true. You gotta understand,
my experience comes HEAVILY from a web environment (this windows forms thing
was something new to me a year ago.) So we didn't have half of the stuff to
worry about that a windows developer does, (i.e. hardware, various OS's,
etc)

Now, I wouldn't necessarily count on the fact someone else is going to
answer the same way. There are a lot of BS "web developers" out there that
will not answer that way. And I do mean a lot. You have to remember, web
programming is even more of an infant than any other type of development
*except mobile, but excempt that for arguments sake*, so 100 different
people will answer 90 different ways. And if our only concern was how to
store data when dealing with multiple page forms, well then, web development
would be easy... However, there are about a million other things (I
exaggerate) to worry about when doing web development, not just how to store
some data. Again, your answer isn't wrong, thats just a .NET way to do it.
If it were Java/JSP I would have said Beans... And if it were ASP 3.0, I
would have said pretty much the exact same thing you did. =)

I wouldn't worry about that question too much though. Yeah, its good, and
could apply to a lot of situations, but then again... you kinda need to know
the situation to make a fair judgement call. If they are going to not hire
you on the basis of one answer, especially that one, think do you really
want to be in the environment with those people anyways?

Finally, data storeage doesn't make a web developer, if your on this
newsgroup (which is pretty much the best VB forum I've ever seen especially
with the fastest response time and most talent with people like Cor, Armin,
Tom, and Herfried "Captian Links" Wagner, your definatly on the right track.
You will learn so much from people in here and they from you. So even if it
doesn't happen this time, keep learning and kick ass at the next one.

And I'm out this mo fo...

-CJ
 
I like session variables as it allows easier to maintain code. For
example, I can add links throughout the setup process that link to
other pages, and no page has to know how to rebuild the complete url
with parameters. Each page just links where it needs to. They can
all include a common header that knows about all the possible POST
variables to throw into the session. So any page can link to any
other page, without fear of losing data anywhere.

Just my .02.

Kevin
(e-mail address removed)
 
Terry,
They use session variables for everything ? I mainly use session
varibles. So they might end up with 30 or 40 session variables for a
particular report.
I would use a single session variable, holding an object that had 30 or 40
properties (and fields). or a couple of session variables holding a couple
of objects that had 15 or 20 properties each... It really would depend on
the OO-ness of the data being held... Further I may use a combination of
methods, depending on the kind of state I am holding for each "variable"...

Remember that ASP.NET has a number of facilities to store variables between
round trips with a client:

The following may be helpful for you to review to find your options:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconWebFormState.asp

Specifically:
http://msdn.microsoft.com/library/d...vbcon/html/vbconChoosingServerStateOption.asp

The following article provides a good overview of the 9 options available:
http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx

Hope this helps
Jay
 
Back
Top