Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 18th, 2011, 06:51 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default Generic Question and EF

I see you use generics in your examples in the book in Chapter 17. I was just wonderin if you could explain generics better. There have been whole chapters written about Generics. As I understand it they are class objects without any real data type attached to them. Kind of like the variable declartions in JavaScript no data types attached to them. Is that not the case. I think that with generics it makes it easier to type cast variables to objects easier as it allows for more of an easier allocation of stack and heap conversions when doing typecasts from variables to objects? Is that right?

Also what are the advantages and disadvantages of using LINQ and the EF and using straight calls to the database using stored procedures. Does not LINQ and the EF put a lot of overhead that causes the scalability issues for large user groups problems?
Reply With Quote
  #2 (permalink)  
Old May 19th, 2011, 02:40 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
As I understand it they are class objects without any real data type attached to them. Kind of like the variable declartions in JavaScript no data types attached to them. Is that not the case. I think that with generics it makes it easier to type cast variables to objects easier as it allows for more of an easier allocation of stack and heap conversions when doing typecasts from variables to objects? Is that right?
Nope. It's pretty much the exact opposite. With generics you can create strongly typed classes. However when you define the generic type, you leave the actual type to the user of your type. Generics are best seen as templates. Imagine the following List<T> class from the .,NET Framework:

Code:
 
public class List<T> : ....
{
  public void Add (T item)
  {
 
  }
}
When you declare a type with this class like this:

List<int> MyList = new List<int>();

the compiler uses the orginal list as a template and creates a class such as this one:

Code:
 
public class ListInt : ....
{
  public void Add (int item)
  {
 
  }
}
The same could happen for a string type:
Code:
 
public class ListString : ....
{
  public void Add (string item)
  {
 
  }
}
This is not exactly how it's done, but it comes close to the underlying concept.

Check out Pro Generics by Tod Golling: http://www.wrox.com/WileyCDA/WroxTit...764559885.html for way more details.

Quote:
Does not LINQ and the EF put a lot of overhead that causes the scalability issues for large user groups problems?
No, not if done right. StackOverflow.com is one of the busiest sites on the internet and it uses LINQ to SQL.

Can you please post a new thread for a new topic? Also, the last question (and possible the first) are much better off in generic forums about ASP.NET or .NET as they are not directly related to my book. Just pick an appropriate forum category here:

http://p2p.wrox.com/asp-net-asp-12/
http://p2p.wrox.com/
Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old May 19th, 2011, 03:11 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default Jquery to Ajax?

You cover AJAX and Jquery in your book. What are the major difference and what are the similaries other than they are both Javascript? The way I look at it, they are both interchangable are they not?
Reply With Quote
  #4 (permalink)  
Old May 19th, 2011, 03:30 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

It depends on what you mean by AJAX. You can do AJAX - as a concept - with jQuery...

If you mean ASP.NET AJAX, then yes, some of it is / was overlapping with jQuery. However, now that Microsoft is embracing jQuery, the ASP.NET AJAX library is slowly disappearing. The server side part (UpdatePanel etc) remains.

For all the dirty details: http://visitmix.com/writings/javascr...-and-microsoft

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #5 (permalink)  
Old May 19th, 2011, 04:14 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

BTW:

Quote:
Can you please post a new thread for a new topic?
How are AJAX and jQuery related to Generics and EF? Separate threads for separate topics make things much easier to find for everybody....
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions related to ADO.NET EF and one unrelated Rushino ASP.NET 4 General Discussion 6 July 29th, 2010 08:41 AM
How can i make this generic girija45701 C# 0 November 29th, 2008 04:32 AM
NewBie: VS2005 generic question. psash Visual C++ 2005 0 August 17th, 2008 06:44 AM
Generic return type mega C# 2005 1 November 30th, 2006 07:27 AM
Problem with generic collections demitry Visual Studio 2005 1 November 21st, 2005 05:30 PM



All times are GMT -4. The time now is 06:30 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.