Thursday, June 19, 2008

Oracle in .Net

Alex Keh Alex.Keh@oracle.net
(works with)Christian.Shay@Oracle.Net
cshay.blogspot.com

11g Client Supports Source Control with TFS 2008 or VS
- Will Work on 10 and 9 Version of oracle DBs
Can Debug with VS using Oracle SQL Developer
- Need Oracle Dev Tools for VS
- http://otn.oracle.com/dotnet to download tools
- Oracle Developer Tools for Visual Studio
- Oracle Data Provider for .Net
- Oracle Providers for ASP.net - Add users to Db as OracleUser
- .Net SP - Dev VB.net STPs in Oracle
Oracle Plugin for DBPro will probably be in Rosario
Support for LINQ - No date - say its 2-4x slower running. Trying to make sure its right before releasing

This was an interesting discussion on what people are looking for to connect to oracle. Everyone agreed that using the Oracle data Provider was the best choice to connect to Oracle as All others were missing stuff, or had incompatibilities with Oracle. Looks like we can check in any work in we create in Oracle to TFS with 11g client, that will be nice

Lesson Learned Unit Testing

Lesson #1: Write tests using the 3A pattern
Arrange - Set up the test harness
Act - Run the thing you actually want to test
Assert - Verify the results
Benefits
Readability
Consistency
Liabilities
More verbose
Might need to introduce local variables
Lesson #2: Keep your tests close
Tests should be as close as possible to the production code
Keep in Same assembly
Treat them like production code
Liabilities
Should you ship your tests?
Lesson #3: ExpectedException leads to uncertainty
Violates 3A
Record Excpetion Instead
Problem:Don’t know which line of code threw the exception. Test can pass for the wrong reason
Test For Exact Exception if doing this
Benefits
Readability
Identify and isolate the code you expect to throw
Liabilities
Act and Assert are together
Lesson #4: Small fixtures
Your code should be a book for people to understand
Break Unit tests up into easy to read section
Benefits
Smaller, more focused test classes
Liabilities
Potential code duplication
May consider duplicating code if it’s for the purpose of communication
Lesson #5: Don’t use SetUp or TearDown
You can end up with a test that doesn’t need anything from the SetUp method.
If SetUp takes a long time, you’d be paying the price for every test, even those that don’t need all of it
Put duplicated code into a method, and calling it at the beginning of each test
Benefits
Readability (if it removes duplication)
Test isolation
Liabilities
Duplicated initialization code
Lesson #6: Don’t use abstract base test classes
Shouldn't be a problem as VSTS doesn't allow them

Interesting Stuff hopefully we can make good use of this in our unit tests

Monday, June 9, 2008

Subtle Power of Data minig Algorithms

Microsoft gives 9 Different Data Mining algorithms with SQL server
How much Data is enough
- As Many as is a valid Model
- OverTraining of data possible by Bad parameters
- Too much Data can make a bland mode
What is a Valid Model
- Accuracy use Lift & Profit Charts, Scatter Plots, or Classification Matrix
- Reliability - Cross Validation
- Usefulness - Requires Human eye
How to decide which prediction is most accurate
- Lift chart - Bigger the number better the score
- Scatter plots - need a lot of data
- Clustering is not good for predicting, but is good for trending
- Naive Bayes - Oldest, usually least accurate
- Decision Trees - used for classification and association
- Regression - Look for Regressor- use to predict regression
- Neural NetWork - Finds Pattersn when all others fails...Difficult to interpret results
Fold - Partitions - Want models that are exactly the same
- Make subsets of data
- Chose model with least standard deviation
Control "Depth of Insight"
- Select based on most important columns or column values

IDE Tips & Tricks in vs2008 (Some work in 2005)

1) can use objects outside solutions
2) Repeat Search - F3 - Highlight a word then Crtl -F3
3) Box Selection - Alt -Shift...use direction arrows...select stuff in a box...does not highlight items at beginning of 2nd line
4) Cycle Paste - Ctrl -shift U...Cycles though what is on clipboard...Will need to turn off copy in Text -> Editor -> Properties
5) Toolbox General Tab (looks like I missed writing notes on this 1)
6) Snippet - Tab - Tab.... uses key words to help find snippet you want
- Code Snippet Editor - add,remove, import snippets
7)Command window - ctrl I, find Combo box can be used for parameters for commands demos showed finding routine in combo...press F9 (while still in combo) puts a break point at beginning of routine
8) right click - tab...Close all windows but this one in VS
9) Ctrl -Tab...brings up list of all files open
10) Change font size -- Properties, Environment, fonts and colors...can pick environment font for your machine
11) Different window layouts
- Full screen Mode Shift-Alt-Enter
- File mode (missed command)
12) Misc File Project - Finds code not in Project, will add to solution
13) Open Visual studio where you want...can set what happens when you start visual studio, can set to open last solution worked on
14) Trace Points - Built in Trace statements that log on your behalf (to debug window)
- Right click a line -- choose add tracepoint
15) Conditional breakpoints - Break points that are conditional now have a "+" in their brown circle at start of line
16) remove unsused "Using" statemnts... Right Click file - Remove unused using is a choice
17) Watch Window - can have 4 instances of watch windows up at 1 time, can change values of items your watching as your code is running
18) Datatips - Can change values of items as you hover over them
19) Immediate window
20) Recording Macros -- Tools-Macros-record temporary macro

Social Networks Sucesses and Pitfalls

A place to facilitate conversations, conversations about your company will happen weather you do this or not, now get to control somewhat how they go.
Useful to mine data from people who visit and register
Used internally to to find experts in the company
Employees coming straight from college are used to using this type of application to collaborate and share ideas
Need to beware folks becoming professional bloggers - and spend a lot of time just answering questions
Gives people a venue to find answers before they get too frustrated
More openness - Makes company seem more friendly
Can use internal blogs to help folks internally ask questions
Setup forums to answer questions - Forums are nice as they are easily searchable, so same answers are not given over and over
Have forums setup to send emails to people when new question are posted, so response to questions isn't too long.
People are using blogs to post meeting notes so people can read them ask and respond to questions from the meeting
Hvew to be prepared to have people invest their time, even force them if nessecary to make sure the content doesn't go stagnant (talking about blogs)

Team Build Muscleman

The main reason to do Continuous integration builds is to know when something broke the application. You can add test list to the build project and have them run everytime you build the app.
2008 enhancements - Build Explorer and Build Notifications
To override setting in Build projects, use the .rsp file and put the changes you want in there, or go further and build at command line and put changes in command line
- Warning need to control how many builds you keep or they will start to take up considerable amount of disk space
- Can use the SDC tools to repopulate ad DB on Deploy if desired
- IF using SDC, add to project so you can add to source control
- use message text ="" So you can search build out put as build output can be thousands of lines long
- in target dependsontarget="section" tag To run
1st before this target
- Highly recommend TFSSideKicks (Attrice.com)
- 2005 builds will not seamless migrate to 2008.. They will need modifications
- Use Custom build steps so you get feedback when a part of the build is running
- Keep Test in Different projec, but same solution in Source control, this will make it so you can run them when you build
- They reccomend not team building to production, but it is ok to do dev and QA
- WIX (Windowsn installer for XML)
- WIX protects are another type of Project in VS
- use this to build MSi's
- Its an addon, can get from www.sourceforge.com\releases

Sunday, June 8, 2008

Thank You

Thank you for the opportunity to attend TechEd 2008 this past week. I found some better ways to do things and got to see the new improvements that are coming our way. I enjoyed talking with other developers in the industry, exchanging ideas, and being able to ask questions. The week was exhausting, but I really did learn a lot.

Here are some photos from the week.






















How NOT to write a Unit Test

Discussion by Roy Osherove of Typemock
View in the Blog: Iserializable.com

Open discussions from the group:

• Unit testing for Data Access
• Link to existing code (Legacy)
• Duplication between Unit Tests and function tests
• Other platforms or older languages
• Unit testing after refactoring
• Interface Testing
• Can you write unit tests w/ only what Visual Studio provides

Book: The Art of Unit Testing
http://The.ArtOfUnitTesting.com

Unit Testing should be a test of small functional pieces of code

What’s assumed is that it will make it easier to find bugs, which is not necessarily true because there can be errors in the text, it should make things easier to maintain (perhaps if you refactor your tests), and it will make it easier to understand the code, which may not necessarily be true if you’re not testing for the right things. However, if the prior three are correct, it should make it easier to develop.

Testing with a real world agenda:
• Make test trustworthy so that testers will run the tests
• Make sure you are testing the right things
• Make the test fail first, then work on making it pass (make it fail when it should, and pass when it should)

Assuring code coverage—that you have created testing in all the necessary areas.

Avoid testing logic
• No Ifs, SWITCHs, or CASEs
• Only create, configure, act and assert
• Test logic = test bugs (don’t repeat the same algorithm in your test as you use in the app because the app logic may have a bug)
• State-based testing
• Make tests easy to run—try to make all the tests run from the click of one button
• Create maintainable tests--test only public APIs (testing private makes the test brittle)
• Reuse test code as much as possible, don’t write a new test for each piece of logic

File Structure—for each project create a test project with the same name and add a suffix like “_Test”. You may want to create a test file for each class in the project.

Avoid multiple Asserts
Don’t over specify
Avoic Mocks if you can, although, you have to do it sometimes in order to return something back into the calling class

Another good book: Working Effectively with Legacy Code – Michael Feathers

Tools: ReSharper Tool, Rinomox

Developing High Performance JavaScript, AJAX, and Layout for Microsoft Explorer 8

Cyra Richardson
Senior Program Manager Lead – Microsoft Corp.
cyrar@microsoft.com


JavaScript Coding Inefficiencies (IE7 Only):

Background: String concatenation
Recommendation: Array.join for string concatenation instead of doing a plus equals on a large string and continue adding to it.


IE8 JavaScript Improvements:

Strcat is faster for large and small strings better than ArrayJoin
Strings are not flattened until the are pass to DOM
Str canlls may flatten strings
Array lookup is faster
Array.Push and Array.Pop are faster


Background: Costs for using EVAL

Download
Build string
Construct new script execution context
Lookup string
Parse
Execution

JavaScript – SWITCH becomes costly for large sets
Problem: Switch processing time grows linearly
Consider: Hash Table wrapped in Try, Catch
Why: JS does not optimize SWITCH

JavaScript – WITH
Problems: Increased symbol lookup time everywhere

Better control over Jscript Closures

Property Accessor Functions (get/set)
Problems: Increases cycles to access values
Consider: Directly modifying variables
Why: Inserts and additional symbol lookup




IE Performance Considerations:

Instantiating DPM functions
Problems: Costly (in CPU cycles)
Consider: Get ElementById, QuerySelectAll, Node.NextSibling
Why: Platform Genericness

Accessing/Traversing DOM properties

Traversing Sibling Nodes

Accessing DOM
* DOM methods are faster to get items than InnerHTML
* GetElementByID better than walking the HTML
* QuerySelectorAll

First visit interactions
Reoccurant visit interactions
Request from Server/Download from Cache
Cache content for subsequent visits
Conditional HTTP Requests
Plain HTTP Request
Pragma: no-cache
Recommendation: For subsequent Visits – Cache Control
• Time Conditional--If-modified-since: datetime
• ETAG Conditional--If-none-match: etagvalue


Tools And Techniques

• Developer Toolbar
• Fiddler—XML HTTP request monitor
• AJAXView--by Microsoft Research. Like Fiddler and watches your javascript functions and tells you how much time each step takes.


“High Performance Websites”-- (great book) by Steve Souders

Solving Performance Problems:

• Identify the type of performance problem
• Network/Bandwidth – use Fiddler
• JavaScript – use DevToolbar
• Aggressive DOM access – using DevToolbar

Reduce, Simplify, Re-factor
Reduce the bytes sent between client and server
Simplify your code to avoid costly JavaScript constructs
Cache DOM properties and function pointers

Use Try/Catch instead of a big SWITCH

Saturday, June 7, 2008

Conference Summary

The TechEd conference for 2008 has concluded and we are all very tired from 5 full days of learning. Overall the experience was good. The highlights for this year was the release of Visual Studio 2008 (Released already), SQL Server 2008 (Release date 06/2008), Silverlight (1.0 released already and 2.0 in November) and some interesting Mobile features (Available Now).

I recommend that we migrate to Visual Studio 2008 as soon as possible and that we find a way to incorporate Silverlight into our development standards. VSTS 2008 adds several new and exciting features to improve our development process. Silverlight is a "Flash" type software that will help spruce up the UI without the help of graphic designers. Last but not least, we saw some mobile features that would allow the mobile devise to connect to our domain which would then allow the users to access our applications. Of course we would have to write some of them to work with the mobile device.

In conclusion, I want to thank Bob for allowing us to attend the conference as I gained a lot of valuable information. All the Microsoft resources are available in one place. If you don't understand something all you have to do is ask one of the experts.

This years conference was a little different in that they split the developer and the IT conference. There were only half the amount of people this year which was good. The food was terrible, but good enough for us not to have to eat out for breakfast and lunch.

Overall I think the conference was a success and I am very glad I had the opportunity to attend.

Taking Applications to the Next level with Data Mining

Why Data Mine
- Too much Data not enough Info
- Enables Data exploration
- Use to solve following Buisness Scenarios
- Identify responsive and unresponsive customers
- Detect fraud
- Target Promos
- Forcast Sales
- Cross-selling
Whats in SQL 2008
- Has 9 Algorithims to extract Data
- Decisions Trees - Most Popular
- Clustering - Finds naturl groupings
-Sequence Clustering
- Naive Bayes
- Line Regression
- Logistic Regression
- Association Rules
- Time Series
- Neural Net
Data Preparation
- Significant amount work is normally involved in getting data ready for Data Mining. It helps greatly if you plan for this when designing your Database.
Data Mining Visualization
-OLTP and OLAP will return exactly what is asked, be careful you ask for thins correctly
-Can use Analysis Services Project in VS to help

Friday, June 6, 2008

UnderStanding ADO.NET Entinty Framework

by Erik Thompson -- ereckt@microsoft.com
Why the Entity Model
- Bridge Gap between OOP and relational databases
- Complex Types
- Your Data Model is not tightly bound to your DB
Creating Model
- EDM is represented as XML
- Use Ado Entity Designer -in vs2008 sp1
- Start Blank or from a Database
- Supports Many- to -Many relationships
- Entity Framework Requires 3 artifacts
- Model -CSDL
- Definition of Store - SSDL
- Mapping between the 2 - MSL
Programming Against it
- Enity Types
- CLR versions of EDM entities generallt generated by Tools
- Object Services
-LINQ
- Used to query against the generated classes
- Entity SQL
-SQL Variant for working in EDM
-String based not SQL
- Always keep entities attached to Object services
- Relationships are single worst stumbling blocks of EDM

TechEd Night at Universal

Microsoft rented Universal Studios theme park last night for 3 hours of free food, drink and rides. Although, they did close off about 1/4 of the park. Didn't get to ride the Mummy or Jimmy Newtron because they were in that part of the park. Lines were a little better than last year and we got to check out the replacement for Back To The Future. It is a Simpson's ride that is very similar to the old one, but in cartoon format. Pretty neat.

Julia will not be coming back to work because she was the star of her on movie called Disaster! You should see her now with her star sun glasses! :) Men in black was the other attraction that we got on. The best part was being able to eat and drink anything in the park, although I did not partake in any alcoholic beverage.

So there you have it, our night out on Microsoft(not). Off I go!

New Windows Mobile Entriprise Archetecture

Current 4 types of data Networks
- CDMA -This is generally what is found in the US
-GSM - This is generally what is found rest of the world, tho is also inUS some
-UMTS - Is an upgrde of GSM, to work more like CDMA
-OFDM - Is the technolgy befind wi-fi, and wi-max networks

System Center Mobile Device Manager (is windows server for mobile devices)
-Using mobile 6.1 can have moble devices join a domain (using mobile vpn)
-This allows mobile devices to be like computer on local domain so the can access intranet content without difficulty
-Makes it easier for company to push setting they want to mobile users
-Server keeps mobile vpn sessions even if mobile device is fading in and out of coverage
-Uses Direct Push Technology - Exchange knows where you phone is and will push items out to you, even works on Iphones
-Uses Queing, means it will only push out stuff whan it knows it will succede
Mobile Merge Replication
-Integrated with SQL2005
-used to sync with Databases on Mobile devices
-has wizards to build filters for what is pushed out
-Sql2008 -Sync Services for Ado.net
-Sends data litltle at a time, can set what size batch you want to send
Mobile Web to Terminal Services
-Can terminal server so you can use apps not degined for mobile

SQL Server 2008 Integration Services: From D’oh to Wow

This was a class about the pros and con of using SSIS (SQL Server Integration Service)
  • Use SSIS to Load two flows in parallel instead of doing Union ALL
  • Have made improvements in SQL Server 2008’s buffering which make a significant improvement in the time to bring in large amounts of data. When caching data for the lookup component you cache entire table and that wastes memory. Fix: do not use Select *
  • In 2008, caches can also be persisted for even better performance and scale.
  • In 2005 use a View instead of a table so you pick only the columns you need to cache.
  • If querying two or more tables and you want to use the same cache, use the same column names in both queries even if all tables don’t have the same columns in it.
  • Doing to much work in SSIS often causes a serious performance hits. Joins and sort that make use of indexes in the database, are instead performed expensively in SSIS. Rows or columns which are not used may also be extracted. Push filtering, sorting and joining into the source system if possible – so long as source system resources are available.
  • Row sampling or row counts can be used as destinations. Can execute the package without the destination to determine performance bottlenecks. This is a method for testing performance without put the data on the destination.
  • Loading many flat files. Use the Multi-Source Flat-File Source Adapter. Loads similar files.
  • There are Data Mining techniques that can be used as the data is coming in.

http://bi-polar23.blogspot.com
Matthew Rocae BI/SSIS BLOG

Summary: SSIS is the upgraded version of DTS packages. Unless we want to take advance of the SSAS and Data Cubing or Data Mining I think we could continue to move our data using store procedures. I talked to the presenter of this class and he agreed.

Thursday, June 5, 2008

Microsoft ReportViewer Control 2008 (Green Theater 2)
Stella Chan

Shipped in vs2008
Works in both server and local mode
Server mode – when used with sql server reporting services 2008, it calls the backward compatibility interface
Local Mode – it is using the RDLC 2005 schema and does not support the new SSRS 2008

Many new charts and report types
You can create a template, however, no CSS available at this point
Can bind the report to an app

Private void form1_Load(object sender, Event Args e)
(
AddEmployees();
This.bindingSource.DataSource = employees;
IEnumerable q =
From emp in employees
Where emp.id < 1
Select emp;
this.BindingSource.DataSource = q;
this.reportViewer1.RefreshReport();
)


Custom Code:
Expression
Embedded Code
Report Properties Dialog to Code
Code.Function(Parameters…)
Custom Assembly:
Compile your own assembly and copy to Visual Studio PublicAssemblies folder (BIDS)
Report Properties Dialog to Reverences
Namespace.ClassName.MethodName(Parameters…)
For instance based methods, need to create the instances under the class section.
Code.InstanceName.MethodName(Parameters…)
Custom Report Item: (a lot more work)
-----------

Custom Code:
Interlaced rows in Tablix (RunningValue used in nested row groups)
Consistent colors for series data points over multiple pie charts
Nested data regions with consistent custom colors.

Ways to improve your code

Neal Ford – Ways to improve your code

• Metrics and Anaylsis
• Good Citizenship
o Properties != encapsulation
Kill accidental complexity
Ceremony vs. Essence
Static vs. dynamic
F#

Don’t invent your own caching framework
Don’t buy an entire tool suite if you only use 10% of the product
Don’t use Biztalk
The old “we can’t use open source code because the lawyers say we can’t” is ridiculous.
Don’t have an architect review all of the code before allowing items to be checked in.
Don’t keep ALL of the logic in stored procedures just because you think that it keeps performance from slowing down.
Perform unit tests. If you have to spend too much time debugging, then you have time to do unit tests.
Handle exceptions.
Question authority. Don’t do things a certain way just because it’s the way you’ve always done them. Know why you are doing it that way and fight it if it’s not a good way to do it.
Create fluent interfaces and do away with too much code.
Don’t name interfaces with a leading “I”…instead creat good naming patterns so you can find things.
Pier programming is a really good idea. Two people are slower to code, but are far more accurate. It ends up saving time in the long run.
Software Development Anti-patterns—(i.e. Give me an estimate Now!!) It takes detailed research to determine exactly what needs to be done and the best way to do it. You need to try to determine up front any problems that might occur so that you can find the best way around them. Otherwise, nobody can stick to an estimate.
Composed Method – “SmallTalk Best Practice Patterns” is a book that you should read even if you don’t care about SmallTalk. The solutions they came up with for patterns in this book are very good.
Polyglot Programming (Language != Platform)—leverage existing platforms with languages targeted at a specific platform. (i.e. IronPython, IronRuby, Django, Ruby on Rails—which makes writing unit testing easier)
Learn everything there is to know about your language like reflection, regular expressions, and dependency injection.
Anti-Objects (look up OOPSLA)
PacMan code is very poor because the ghosts can only tell where PacMan has been, but they can’t cut him off at the pass or guess where he’ll be next.

T-SQL Tips and Tricks

T-SQL Tips and Tricks

Cursors—are ok if you are just iterating through, but are bad for updating. Instead do Select Top 1 and Order By to update a temp table. It is the best method if you need to do anything to the data.

Common Table Expressions – are best for solving complex problems. Non-persisting temp table. Can be used in places where a temp table doesn’t work.

With CTE_TechEd
AS
(
Select * from Sales.SalesTerritory
)
Select * from CTE_TechEd

Recursive Query with MAXRECURSION

With SimpleRecursive(field, field)
As
(
Select Emp, Emp_Id, Reports_To_Employee from Employee_Tree where Empl_id = 2
UNION ALL
Select Emp, Emp_Id, Reports_To_Employee from Employee_Tree P Inner Join
simpleRecursive A on Empl_id = P.Reports_to_Employee
)
Select sr.Emp_ID as employee, et.Emp as Boss
From SimpleRecursive sr Inner Join on sr.Reports_To = et.empl_id
--Employee_Tree et Option(MAXRECURSION 2)
(Note: this is supposed to stop recursion at whatever level (number of times) you set,
However, a level 16 error gets raised in ADO.Net error 530)

Common Table Expressions method of finding dupes rather than self-join
Finding and removing duplicates with a CTE

Thurs, 10:15am -- Deep Dive into the ASP.Net AJAX Extensions

Thurs, 10:15am -- Deep Dive into the ASP.Net AJAX Extensions
Jeff Prosise --Cofounder, Wintellect www.wintellect.com

Architecture:

ASPX and ASMX

ASP.Net AJAX Extensions
• Server Controls
• Application Services Bridge
• Asynchronous Communications

ASP.Net

• Framework & Server Controls
• Application Controls

Server Controls
• Script Manager – Starting point for asp.net ajax pages
• downloads javascript files to client enables partial page rendering using update panel
• Provides client side proxies for web services
• manages callback timeouts and provides error handling
• options and infrastructure
• Provides registration methods for scripts
• Enables ASP.Net AJAX localization support
• Every page requires one script manager

AllowCustomErrorsRedirect – so you can provide error handling

ScriptManagerProxy--
Proxy in content pages of ScriptManager controls declared in master pages
Lets content pages declare page-specific script and service references

UpdatePanel –
Partial-page rendering in a box
Clean round trips to server and flicker-free updates
Requires no knowledge of javascript or ajax
Leverages client-side PageRequestManager
EnablePartialRendering = true

Content Template and Triggers Element –

Triggers—used to reach outside of update panel to things that need to kick off a partial-postback.

1) script manager
2) update panel
3) put content template inside (with all markup inside that)

Now it no longer needs to do full postback (no blink)..it only does a partial and update the image

Downside of update panel –
Too much viewstate kills performance.

Web Development Helper – plug-in that is very useful to analyze traffic (get download)

30 or over of viewstate is too much

PageRequestManager – it is the key to customizing the update panel. It’s a clientside object that contains guts of update panel
Exposes a javascript API. By being aware of PRM you can allows conditional triggers.

UpdateProgressSchema—useful for progress bars, etc. Just display though, no percentage is available.
Update Cancellation – by capturing isInAsyncPostBack and then doing obj.abortPostBack.

Two update panels can update in one round trip to the server.

ASP.NET AJAX Web Services

ASP.NET AJAX support ASMX Web methods as endpoints for asynchronous AJAX callbacks
Efficient on the wire (no SOAP or XML)
Efficient on the server (no page lifecycle)
ScriptService attribute on server indicates Web service is callable from client-side script
JavaScript proxy on client enables …
To call a web service, create a service Reference
Handling Errors – create handling
(i.e. onFailed (err, context, methodName) { alert(msg); }


NOTE: Can create an autoFill function instead of using updatepanel for performance enhancement.

ASMX Wire Format
ASMX Request Handling
Script-Handler-Factory (lookup)
RestClient-ProxyHandler
RestHandler
Helper Classes
WebService-HandlerFactory

JSON—JavaScript Opject Notation (versus XML)
Used in AJAX. Lightweight data interchange format which is less expensive in serialized volume. However, JSON cannot handle a dataset, which is why XML is more powerful.

Page Methods:
Script-callable Web methods built into pages
Implemented in ASPXes, not ASMXes
Page scope rather than application scope
Same efficiencies as ASMX Web methods
Simpler than writing a full-blown Web service
Do not require service references
Do not require dedicated ASPX files
Must be public static methods
Called through PageMethods proxy on client
Note: Have to be static because they don’t have to run through a page lifecycle

Built-In Web Services
AuthenticationService
Front end to ASP.NET membership service
Called through built-in sys.services.authoenticationService proxy
ProfileService
Front-end to ASP.Net profile service
Called through sys.services.profileService proxy
RoleService(ASP.NET 3.5)
Front-end to ASP.NET role manager
Called through sys.services.roleservice proxy


Samples Link: http://wintelect.com/webdemos.aspx

Example: Burton Snowboards

Data References In DBPro 2005

Discussion of database references within the DBPro.

Presented By: "Data Dude" Gert
  • Can only represent 3 or 4 part names
  • Reference can be to .DBPROJ or .DBMETA files
  • Referenced schema's are loaded into the DisignDB
  • Cannot resolve OPENQUERY(), OPENROWSET()
  • Need to create a separate DBMETA file to reference 4 part names i.e. use linked servers.
  • Will need to create a Post-Build event to copy the DBMETA file.

Summary: Many of these issues get resolved in DBPro 2008 that will be released 8 weeks after the release of SQL Server 2008 (Late June 2008)

Visual studio team System 2008 Database Edition

This was a demo of the new DBPro for Visual Studio 2008.

Presenter: "Data Dude" Gert Drapers

Will release in June 2008
RTM in 6-8 weeks after SQL Server 2008 RTM

  • Will be model based and will no longer require a local instance of the DB
  • Separation of the build and deploy
  • Schema will be saved in .SQL files and will break them down into small components.
  • Refactoring will happen automatically when a change is made to the db. It will list all the areas that are affected prior to the actual refactoring process.
  • User projects and Server Project have been separated
  • Can create composite project to limit rights to the tables so developers can create views,procedures and functions, but can't touch the tables.
  • Database References have been improved.
  • Improved Schema Compare but the RedGate product is still better and will cost $395.00
  • Full support for SQL Server 2008.

Summary: They have made some major improvements to the DBPro, especially in the area of DB references and full support for SQL Server 2008. Still can't be used by the Developer Edition of the Visual Studio which means that Steve, Alan and I will be the only ones to use this product.

top 10 web mistakes and how to avoid them

10) Errors in Code
validation.wc3.org to test pages...must sent files for intranet pages
9) Not Isolating hacks
Put code for browser specific items in seperat file easy to keep up to date
8) No easy navigation
User should be able to find what they want easy
7) Inconsistant site design
6) Bad user workflow
think of how users will navigate through page
5) Only providing rich media content
make sure non-rich content works
4) obtrusive ads
we wont worrry about this 1
3) not optimizing for search
2) non-designers designing
I think they were talking about me and color schemes
1) Lousy and out of date content

Wednesday Night at Jellyrolls

Well we had nothing to do on Wednesday night, so I suggested that we go to Jellyrolls where they have dueling piano players. The musicians were fantastic. We were planning to stay until 11:00pm, but we ended up staying until 1:00am. Obviously, this made it very difficult to wake up this morning, but we all made it on time for our conference sessions today. If you are ever at Disney's Boardwalk I highly recommend Jellyrolls for a lot of fun.

Best Practices for Error Handling and Defensive Programming in SQL Server

This session discussed Error Handling in SQL Server 2005

Types of SQL Server Errors/Exceptions:
Statement Terminating
Batch Aborting
Connection Aborting
Service Terminatin

SQL Server Error Severity:
Error <10 is just an error not severe at all
Error >= 11 Exceptions
Error >= 24 are Severe

XACT_ABORT: Turns stement termination into batch abortion

Error Number (somewhat importing)
Error Severity (important)
Error State (not important at all)
Error Procedure Name
Error Line Number
Error Message

Way of displaying Errors in SQL Server
The RAISERROR Statement

Exception Handling
Use to be @@ERROR in SQL Server 2000

In SQL Server 2005
BEGIN TRY
Select * from Sales
END TRY

BEGIN CATCH
Select ERROR_NUMBER
END CATCH

TRY CATCH FUNCTION:
ERROR_NUMBER
ERROR_MESSAGE
ERROR_SEVERITY
ERROR_STATE
ERROR_LINE

Summary: The Try Catch is the big change in SQL Server 2005/2008 and replaces the @@ERROR. Not much here that we did not already know.

Tips Tricks and Techniques For Building Great Silverlight Apps

1) Follow performance tips Recently published by MS
These can be found at http://msdn2.micosoft.com/en-us/library/bb693295.aspx
2) Never make the user wait and wonder
-avoid static declaration of large files
-use downloader in Silverlight 1.0, or webclient in silverlight 2.0
3) OPtimize Install experience
- Try not to just default MS install message(non-technical folks wont know for sure what it is)
4) Use Timers to drive progromatic animations
5) Support interactive zoom for ease of use and accessibility
6) Use Deep Zoom for truely eye-popping zoom effects
-Will need to download deepzoom composer to get all the information this will need
7) Pageturns
- add effect like turning book pages o the app
8) can we talk
- Have 2 silveright controls talk to each other

Wednesday, June 4, 2008

Realistic Software testing with Microsoft visual Studio Team System

  • Team Tester 2008 now tests AJAX and JavaScript that calls AJAX.
  • Can create automated tests for Web Applications.
  • Functional and Load Testing are point and click. Does not need scripting.
  • All tests can be tied to the work items and can be run overnight
  • Notifications from automated tests can be generated to whom ever is appropriate.

Summary: I think the 2008 version of the Team Tester is a significant upgrade from 2005. I think the use of this product could add a lot of value to the QA process. Microsoft has added alot of funtionality and they have fixed some of the issues in the previous versions. Although, they have not totally handled the testing of grids. Additionally, Weston would have to make a significant investment training the Team Tester Guru.

INETA: Visual Studio from the Trenches (Open Discussion)

BOF803 INETA: Visual Studio from the Trenches (Open Discussion)
INETA provides structured, peer-based organizational, educational, and promotional support to the growing worldwide community of Microsoft® .NET user groups.
http://www.ineta.org/ Discussion #803
Moderators: Bob Goodearl and Chris Pels

This was an open discussion about Visual Studio 2008

By not binding a project to a solution, it would allow the developer to put the project wherever they want to on their machine when checking it out.

Discussed Targeting to a specific framework that you can specify

When to do a website versus a web application

About how Visual Studio often crashes and that annoying message to send Microsoft an error report. A Microsoft participant to the discussion insists that they really do look at them when they go to do future product releases.

Uninstalling expression web helps with speed
Migrating from 2005 to 2008 and how you must have vs2008 installed before loading SQL Tools 2005

If you want to do virtualization, you have to make sure you have “huge” memory on your machine to be able to do what you need to do.

Newest features in ASP.Net and Microsoft Visual Studio 2008 for Web Developers

A Lap Around the Newest features in ASP.Net and Microsoft Visual Studio 2008 for Web Developers
Instructed by: Simon Calvert and Vishal Joshi of Microsoft


Website: http://www.codeplex.com/aspnet/

VS 2008 and .NET FX 3.5
• Web Applications versus Websites and Multi-targeting
o Website – server-side compilation
o Web Application – flavor of class library proect and added web features (more control of assembly model)
o Can select the framework you want to used when creating a new project (2.0, 3.0 or 3.5) to allow multi-targeting.
o Master Pages and Nested Master Pages – A Master Page is a template for one page versus a Nested Master Page which inherits from and existing generic master page
o Split View – design and source can now be in the same page and have instant synching between the two so that you can make a change in one and it is reflected in the other. It can be setup either vertically or horizontally according to your preference.
• Design surface and CSS
o There have been a number of CSS improvements—there are now 3 command windows
o Managed styles
o Circled blue, green and red dots to indicate which styles are actually being used in your page
o CSS Properties – gives you a summary so that you can see only what is being used.
o New styles creator interface that take styles done on a page and automatically put them in the CSS
• Listview server control --Gives you control over layout by inserting a Layout Template and inserting a Place Holder control inside it. It can link to a LINQ datasource. Note: The image is linked to the server using a LINQ Datasource
• AJAX
o ScriptManager with Script References inside of it. You can right click on the textbox to auto add and extender. Pretty cool.




• Javascript Intellisense enhancements
The following gets automatically created and intellisense in javascript starts working and recognizes the variables you add. It also auto-formats the script for you.

Function pageLoad(){

Var e = document.

}

Note: “/// -- can condense references to speed up page

• Dynamic Data – can get data driven website up and running rapidly. It can inspect meta data and validate it.



VS2008 SP1 and .NET FX 3.5 SP1 (Beta)
• Javascript Formatting and 3rd Party frameworks
• ASP.Net dynamic data
• ASP.Net AJAX enhancements

Out of Band Previews (OOBs)
• ASP.Net MVC Preview 3 (Model View Controller)
• VS Web Development Projects

Agile Talk on Aglility

Main things that I got out of the discussion:

  • PM meets with the Customer (Business Sponser) and gather requirements. May not be able to gather all the requirements. Will be constantantly revisiting until all the requirements have been identified.
  • Prioritise requirements the way the customer wants
  • Scrum the determination of the solutions and only do what you can during the sprint time.
  • Complete docs and create sprints– should never be more that 4 weeks
  • PM identifies any new requirement and reprioritizes the remaining tasks
  • Document next prioritized items and create next scrums.

Summary: We are enabling the teams to say YES when changes are introduced. The customer is willing to wait until the next iteration because the period of time that they must is very short. For example, if the customer knows that they only have to wait three weeks to get a change, they are much more willing to wait. Additionally, the development team can accommodate the customer because the requirements are always reprioritize by the customer.

Basically, the PM can only control three things: Scope, time and resources. You can’t control all three. At most you can control on two at a time.

Bugs are to be considered work and the customer decides if they get fixed. This means that we may have to chance one of our variables. Scope, time or resources.

Reference: "The Pragmatic Programmer" – not really an Agile book, but it is really about good practices.

This was the best session that I have attended so far because the speaker conducted the session using the Agile approach.

Pre-conference Seminar: Visual Studio 2008

TechEd – June 2 (Day 1)

Martin Schaeferle--Vice President of AppDev Products
Ken Getz--Sr. Consultant from MCW Technologies, LLC
http://www.mcwtech.com/2008/teched


New Features in Visual Studio 2008:

LINQ – Language Integrated Query

Is a language compiler not a .Net framework feature. It is used to query, set and transform operations for .Net. It makes querying data a core programming concept and it works with all languages. It uses the IEnumerable class. You can LINQ to Datasets, Entities, SQL, or XML. You can basically just write a statement rather than having to loop through something and write a bunch of code. This new feature definitely looks like something that we will want to begin using in the future.

General Format:
From…Where…OrderBy…Select
Note: Select goes last so that it gets intellisense. It must be public and static. It accepts a parameter and the type of thing you are extending.

Example:

Dim numbers As Integer = {1,5,3,6,10,12,8}
Dim oddNumbers = From number In numbers _
Where number Mod 2 <> 0 _
OrderBy number Descending _
Select number

Query Extention Methods include All, Any, Average, Where, Concat, Contains, ConvertAll, Count, Distinct, Except, OrderBy, ThenBym, Select, and more…





Functions require some way to indicate values on which to operate

Lambda Expression:
For Each a As Actor In Actors _
.Where (Function(byVal x) x.Birthdate.Month = 9)

* Acts as an anonymous method.
* Supply a single value and expression return value
* Create a function and call it

You can even query a text file and get all the words that meet some criteria by using a LINQ query.

You can use LINQ to SQL
Server Explorer Window
Drag in tables or stored procedure
Do a LINQ statement to get whatever you want from it or manipulate the data
Then do DB.SubmitChanges

You can LINQ to DataSets(typed and untyped)

Note: VB uses the ! or bang operator, however, C# doesn’t have one. When using LINQ, VB has many more features than C#. This would do away with xsl.

There are samples at 101 LINQ Samples on the http://msdn2.microsoft.com site.


TableAdapterManager -- You can cache data locally. It seperates the dataset and the table adapter. You can also code n-tier applications. By using the TableAdapterManager you can write code that ensures that the right things happen when adding or deleting data from the database. You can use UpdateAll and UpdateOrder. It can be used to synch local data. It has a new set of classes—“Microsoft.Syncronization.Data” Note: Any ADO.Net and SQL Server Compact 3.5 (formerly SQL S Mobile Edition)

N-Tier Architecture--Layers: Presentation, Business, Data Access, and Database.
Note: The DataSet and DataAdapter are now “.split”.


WPF – Windows Presentation Foundation
It takes advantage of all your hardware power, however, it is more difficult than windows forms to get anything to look decent without the help of a dedicated graphics designer. However, with these new technologies, they are vector-based rather than pixel based, so you can scale or zoom without loosing resolution. Same with SilverLight. It is the same graphics engine that determines XML. Note: It would be better to use DirectX for hardcore game coding, however, WPF and DirectX could be combined to write something like that. You can go to http://www.codeplex.com to download a sample.

XAML – Extensible Application Markup Language
It is used to provide markup/XML-based grammer for WPF.

WCF – Windows Communication Foundation
Provides a unified program model for building distributable applications. It is designed for loosely coupled communications.

Services – functionality exposed to outside clients
Endpoints – how services exposes itself to the client
Address (URL, URI)
Binding (TCP, HTTP)
Contract (how data will move back and forth. Written in XML and defines communication

WF – Windows Workflow Foundation
You can manage the flow of an application. Reminds me of the flow design in Pivotal Agents. Visual designer that makes it easy to just drag in activities that you want to perform and wire them up. Activities are workflow controls—while, code, listen, etc.
You execute actions based on conditions. Could be used to kick-off some type of processing and then send emails or create files based upon a condition.

Classes in System.Workflow namespace
Runtime environment
Note: It works in 2005 if you install a few things


Client Application Services

Role based security so that user’s project settings can be saved to the server so that they come up the same no matter where the user logs in.

Office 2007 Projects in VS2008
Office projects can now be built right in Visual Studio. It completely replaces VBA with real code. You can do a single document or create and add-in that can be used again. You can create a Ribbon item to put a bar at the top of an office document that can interact with the database.

T-SQL Querying: Tips and techniques for SQL Server 2005

The speaker was very knowledgeable about this topic. He focused on several specific topics and they were as follows:

  • Common Table Expressions – non persistent temp table that only exist in the executing Query and is only in memory and not in the TempDB. See the following example:
    With CTE_Teched as
    (
    Select * from Sales.SalesTerritory
    )
    Select * from CTE_Teched
  • Recursion Query with Common Table Expression
    With SimplerRecursive(Employee_NM, employee_Id, reportsTO, SubLevel)
    As
    (Select Employee_NM, Employee_ID, ReporttO
    From Employee_Tree Where Employee_Id =2
    Union All
    Select p.Employee_nm, p.employee_id, p. Reportsto, SubLevel +1
    From Employee_tree P
    Inner Join SimpleRecursive A on A.Employee_Id = P.ReportsTo
    Where SubLevel <2
    )

    Select sr.Employee_NM as employee, et.employee_nm as Boss , SubLevel
    From simpleRecursive sr
    Inner join Employee_Tree et
    On sr.reportsto=et.employee_id
    Where SubLevel <=2 –this is a better way to limit the recurrence.
    Order By sublevel ASC
    --OPTION(MAXRECURSION 2) --limits the number of recurrence. Causes an error don’t use it.
  • There is an XML data type in SQL Server 2005 as we already knew. XQUERY is something that will allow us to store XML in the database and then query and manipulate it.
  • Ranking and Windowing - see web site for the T-SQL
    Rank() is a new SQL Keyword
  • Can use pivoting in SQL Server for cross – See web site for the T-SQL

    Speakers Email and WebSite: Stevef@orcsweb.com www.stephenforte.net

Summary: Session was very informative but the focus was very narrow.

Tuesday, June 3, 2008

Off to Epcot

Done for the day, so we will be heading over to Epcot. Julia has never been there before so I hope she enjoys herself. We have been taking pictures to post to this blog, but we forgot the usb cable. So not pictures until we return home.

Date and Time Manipulation in SQL Server

  • Date and Time Datatypes and Internals
    DateTime(8 bytes): 01/01/1753 to 12/31/9999, accuracy 3+1/3rd ms(nearest timetick)
    SmallDatetime 01/01/1900 to 6/6/2079, accuracy is 1 minute
  • Language Dependency
    How to express datetime literals – determined by the login setup:
    Can use Set language command
    Can use Set dateformat command to what you want so the query will run.
    Should use language neutral forms of the date: ‘20030201’ Can set the date to anything, and it will still read it properly.
    Select * from sales.salesorderheader where orderdate = ‘20030201’
  • Finds the fist day of the week in the US
    Select *
    From sales.salesorderheader
    Where datepart(weekday,orderdate + @@datefirst) = 3
    No Separation between Date and Time
    Date only: Convert(Varchar(8), ,dateformat)
    Select cast(convert(char(8),getdate(),112) as datetime) 112 is language neutral. Old method.
    Select dateadd(datediff(day, 0, getdate()),0) any integer will be midnight.
  • New Date and Time support in SQL Server 2008
    DATE – includes only the Date Range 01-01-0001 and 12-31-9999
    TIME – includes only the time. Not normally needed.
    DATETIME2 – changes the range to 01-01-0001 and 12-31-9999
  • DATETIMEOFFSET - can include the time zone

Summary: New Date and Time support ends the HR Vista issues that we have seen. I am not sure if this is good or bad, because we will be allowing bad dates into our databases.

Introduction to Microsoft SQL Server Data Services

Introduction to Microsoft SQL Server Data Services
What is Microsoft SQL Server Data Services?
SQL Server Data Service (SSDS) is a highly scalable and cost-effective on-demand data storage and query processing web service. It is built on robust SQL Server technologies and helps guarantee a business-ready service level agreement covering high availability, performance and security features. Microsoft SSDS is accessible using standards based protocols (SOAP, REST) for quick provisioning of on-demand data-driven & mashup applications.

How does Microsoft SSDS differ from a traditional on-premise relational SQL Server database?
SSDS is built on SQL Server database technologies, used for running mission-critical applications in the enterprise as well as on the Web. Since SQL Server is a broad data platform that can handle all data from birth to archival, there are many capabilities that our data platform provides. SSDS is exposing a subset of those capabilities and extending them as services in the cloud in ways that make it easy for customers and partners to consume and build upon over the Internet. Although SSDS in its first iteration exposes only a small subset of what is in the full SQL Server data platform, Microsoft expects this to increase over time, with likely features including binary large object columns, full text search, and richer data types.

What can I do with SQL Server Data Services? Customers can use SQL Server Data Services to store virtually any amount of data in the Cloud. They can query and modify data as required by the specific business scenarios. SQL Server Data Services support standards-based REST and SOAP interfaces designed to work with any Internet-development toolkit. The primary wire format is XML. Developers and service providers can quickly run on-demand applications with ease. The data has flexible schema which can be modified dynamically by the application. The data is provided with high availability and reliability virtually anywhere, anytime

Summary: Not sure I totally understand this feature. The speaker was very hard to understand. This might have some application within Weston, but I will need to know more to know exactly where.

Keynote - Bill Gates Last Tech Ed

The Keynote Speech was presented by Bill Gates himself. You should have seen the line to get in to the speech. It had to be a mile long. It moved very quickly and the speech was very interesting. Some of the highlights where as follows:

  • Microsoft plans to put additional Modeling tools for the code in Visual Studio. This will allow the developer to visualize the application and even implement code analysis to ensure the architecture is followed. They are making big investments in Model driven development as part of the release of Oslow (next version of visual studio).
  • Silverlight Expression Studio for designers that can easily interface with Visual Studio. Weston should be investigating Silverlight. It very interesting and provides a Flash type affect and makes the application richer. Need to look into whether a PM can design the prototypes in this tool.
  • SQL Server 2008:
    Added a web service called SQL Server Data Services?
    Sync Framework – we need to know more and we plan to attend some sessions to understand better.
    Mobility based development tools look promising for Weston's mobile needs. We will need SQL Server 2008 to do some of these things more easily.
  • Microsoft is offering Services to help with the following:
    Identity federation
    Security
    SQL Server Data Services
  • At the end of the speech Bill Gates had a Q & A. It was very interesting to hear some of his answers.

In summary, Microsoft does not have many earth shattering changes in the development area that we did not already know about.

Monday, June 2, 2008

Developing Microsoft Business Intellegance Solutions with SQL Server2008

Developing Microsoft Business Intellegance Solutions with SQL Server2008, the 2007 Office System and Office PerformancePoint Server 2007.

This was an 8 hour pre-conference seminar that discussed Business Intelligence Solutions.
The main areas that were discussed were as following:

  • Integration Services is used to get the data needed for the warehouse and Analysis Services is used to find patterns in the data.
  • Enterprise data warehousing/Information management – the main data warehousing areas are Cubes (OLAP) and Data Mining.
  • Data Mart/Integrated Reporting and Analytics – The main ways to report on warehoused data are Reporting Services, Excel and PerformancePoint 2008.
  • Business Process/Activity Management
  • Operational reporting
  • Reporting Services:
    - Developer uses the Visual Studio and includes VB or C# to code bells and whistles.
    - There is now a web report designer that allows power users (non-programmer) to use reporting services.
    - Report Builder – adhoc reporting tool and will require underlying support from the DBA.
    - Reporting Services 2008 no longer requires IIS.
  • Will need the following tools to be a BI developer
    - Business Intelligence Development Studio(BIDS) is run through the Visual Studio
    - SQL Server Management Studio
  • Basic Workflow for creating a warehouse
    - Populate the data warehouse
    - Develop reports
    - Build Multdimensional db
    - Produce reports bases on the multidimensional db
    - Enhance online website
    - Build dashboard
    - Create scorecard
    - Develop a planning app.
  • Additionally talked about BI using SharePoint by building Dashboards. Speaker was not an expert on this subject so he only covered the topic at a very high level.
  • If we want the AdventureWorks database for testing of a warehouse we will need to download it from the CodePlex website for SQL server 2008.

Summary Comments:
Weston could use some of the Cube (OLAP) and Reporting features, especially for CPLitePM and some of the future scorecards. At this point I don’t think we are a good fit for Data Mining or using Sharepoint Web parts. Data Mining is used more in the retail industry to determine patterns in the data based on predetermined algorithms. Additionally, we are not on SharePoint 2007. When we go the Sharepoint 2007, there is a much easier interface to create web parts and allow the use to select them for use.

Please see the following link to see the seminar PowerPoint presentations for the Pre-Conferences: https://www.msteched.com/dev/ Login: preconferences Passoword: rocks!

Sunday June 1st Travel Day

Travel was great. No delays and actually arived 30 minutes early. That all happened on USAIR so I am expecting that we will get paid back by being delyed when we return next Saturday.

Steve, Julia and I went to Pleaure Island at night. Really enjoyed the comedy and the 8 track club which played 70's and 80's music.