Access to .NET

beansproutscompleteΛογισμικό & κατασκευή λογ/κού

13 Δεκ 2013 (πριν από 3 χρόνια και 7 μήνες)

82 εμφανίσεις

Access to .NET

Reasons, Strategies and Tools

Overview of Talk


Why move to .NET?


What Access can teach us


How tools can help preserve assets

Why move to .NET?


.NET and Java, through their frameworks
and languages, dominate all new
development since 2002


Microsoft ongoing development


.NET and languages (C#, F#, Python, Ruby)


Sharepoint and Office


SQL Server, BizTalk, other servers


Microsoft Dynamics

The train left the station


Like it or not earlier, valuable systems are
vestiges that Microsoft is eager to lose


FoxPro


Access


Microsoft has a desktop database
replacement for Access


SQL Server Express 2008


Access has much less use than rest of Office

Talent


New talent is in short supply


Knowledgeable of Object
-
Based
environments


Experienced with Web
-
design in some form


They know .NET, Java, Python, PHP


Not eager to work with legacy languages or
systems



Are your systems built to outlast
you?


A good computer system can be written in
any language/product.


Regardless of a language/products merits
it may or may not have a following in
decades to come.


Do you owe it to your clients to future
-
proof the maintenance of their systems?

You can’t chase technologies


Constant change from system to system is
not productive.


Incremental change is productive.


Changing to meet availability of talent
resources is a good strategy.


Changing to add new features is desirable.

C# Language


Complete language


Turing complete


Has been used to create other languages


Has run
-
time compiler features


Statically typed


Object
-
Oriented


Some dynamic feature



Supports Generics like Java, like C++
Templates

.NET Framework


Very large Framework or set of libraries


Handles


IO


Data Access Layer


Graphics


Multimedia


Regular Expressions


Security and more….

.NET Exclusive Features


XML* (Yes you can do this with VBA but..)


Object Relational Mapping


LINQ


ADO.Net Entity Framework


nHibernate


Parallel and Multi
-
Threaded Programming


F#


.NET Threads Library

More features


GUI Toolkits


ASP.NET


WinForms


WPF


Third
-
party and open
-
source libraries


Frameworks, Software Patterns


Tools


Code Generation/ Analysis

What can we learn from Access


Various object models including


Access Object model


DAO (Data Access Object)


Jet SQL (More of a data definition language)


Writing VBA programs with these models
prepares us for similar interface
-
based
programming in .NET


Composite Design Pattern

Traversing collections


We can inventory many assets by
traversing the collections found in the
object models.

' Search for open AccessObject objects


For Each obj In dbs.AllForms


Debug.Print "[Form:" + obj.Name + "]"


Next obj

Containers


Containers contain collections which are
container/composite types.


Forms contain a collection of Form objects


A Form has a collection of control objects


A control has a collection of properties


A property has a value and a type

The Forms Hierarchy

Forms

Form

Controls

Properties

Inspecting the Access Object
Model


VBA is the best for inspecting the model


We can use .NET up to a point


Problems with many of the Access
components that use the earlier dispatch
interfaces from early COM


.NET Com Interop does not understand the
dispatch model



Use VBA to store information


We can write VBA code to store the
information on these assets.


We can reference MS XML


Easier to write to some text file


Use that text to rewrite as XML in .NET or with
XSLT


Take XML Storage


Taking the XML Storage of these assets
we can


Show the inventory of the object model


Use to reconstruct similar forms, reports


How VBA and .NET Relate


Both VBA and .NET use programming to
interfaces


VBA/COM:


Dim f2 as form2


Set f2 = forms[0]


‘ Get the form2 interface supported by the form
class


.NET


Example of using the same interface on two
collections




class Program


{


static void Main(string[] args)


{


int[] nums = new int[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };


List<int> dynNums = new List<int>(nums);



PrintNums(nums);


PrintNums(dynNums);


}



static void PrintNums(IEnumerable<int> ie)


{


foreach (int j in ie)


Console.WriteLine(j);




}


}

End of program


Show examples (WinForms, XAML)


Marc Temkin


773
-
274
-
6544


mtemkin@speakeasy.net


www.chicagoacm.net



Upcoming events on 3/11 and 4/17