Designing .NET Enterprise Applications Xiao-Yun WANG PowerDesigner Chief Architect, Sybase Inc

Designing .NET Enterprise
Applications
Xiao-Yun WANG
PowerDesigner Chief Architect, Sybase Inc
[email protected]
Agenda
 Integrating PowerDesigner with Visual Studio 2005
 Designing .NET enterprise applications
 Integration with PowerBuilder
 PowerDesigner 12.1 new features
Integrating PowerDesigner with Visual Studio
2005
 PowerDesigner 12.1 introduces Visual Studio and .NET
support new features
•
•
•
•
•
Visual Studio 2005 addin
Integration with Team Foundation Server
.NET Code synchronization with Class Diagram
Generate complete .NET application code
Improve SQL Server 2005 support
PowerDesigner Visual Studio 2005 Addin
 Supports all PowerDesigner features inside Visual
Studio 2005
 Provide Visual Studio 2005 developers
•
•
•
•
•
Requirements
UML 2.0
Data modeling
Business Process modeling
MDA
PowerDesigner Visual Studio 2005 Addin
 PowerDesigner Visual Studio 2005 addin supports
Visual Studio
•
•
•
•
•
Menus
Toolbars
Tool Box
Properties View
Output Window
Create New Project
 You create C#, VB, … project or PowerDesigner project
Create New Model
 You can create a model under the solution or under a
project
PowerDesigner Visual Studio 2005 Addin
Requirements
PowerDesigner Visual Studio 2005 Addin
UML 2.0
PowerDesigner Visual Studio 2005 Addin
Data Model
PowerDesigner Visual Studio 2005 Addin
Business Process Model
Integration with Team Foundation Server
 Visual Studio Team Foundation Server provides
application lifecycle management features
• Based on Work Items
• Project management, source control, testing, …
 PowerDesigner Visual Studio addin supports
•
•
•
•
Export Requirements as Work Items
Import Work Items as Requirements
Update Work Items
Team Foundation Server toolbar
Export Requirements as Work Items
Import Work Items as Requirements
.NET Code Synchronization with Class Diagram
 An OOM can be synchronized with C# or VB .NET code
.NET Code Synchronization with Class Diagram
 Changing the .NET code changes the Class Diagram
 Changing the Class Diagram changes the .NET code
Designing .NET Enterprise Applications
 Top-down approach
•
•
•
•
•
•
•
•
Define Requirements
Define Use Cases
Define Sequence Diagrams
Identify classes and operations
Define Business Objects using Class Diagram
Generate Physical Data Model and O/R mapping
Generate database
Generate C# or VB .NET code
Designing .NET Enterprise Applications
 Bottom-up approach
• Reverse engineer an existing database
• Generate a Class Diagram and O/R mapping
• Generate C# or VB .NET code
 Meet-in-the middle approach
• The business objects and database structure are already
defined
• Use Mapping Editor to define the O/R mapping
• Generate C# or VB .NET code
Architecture for Data-Centric .NET Applications
Win From
CAB Layer
Business Logic Layer (BLL)
Domain Model
(POCO classes)
Data Access Layer (DAL)
NHibernate
DAL
ADO.Net DAL
Data-Centric .NET Applications Code
 Domain model
• Business objects for C# 2.0 or VB 2005
 O/R mapping
• NHibernate or ADO .NET
• Factory, Data Access Layer
 Unit test
• NUnit or Team Test
 User interface
• Windows Forms based on Composite Application Block
NHibernate
 NHibernate is a port of Hibernate 2.1 Core for Java to
the .NET Framework. It handles persistence of Plain
Old CLR Object (POCO) to and from an underlying
relational database.
 All Hibernate knowledge and Hibernate documentation
are directly applicable to NHibernate.
 Refer to: www.NHibernate.org.
ADO.NET
 Microsoft ADO.NET is a database-general API. It is an API in
which database vendors write plug-in data providers for their
databases, such as OLE DB/ADO (providers), ODBC (drivers).
SqlClient class
Oracle class
Generic interface
SqlConnection
OracleConnection
IDbConnection
SqlCommand
OracleCommand
IDbCommand
SqlDataReader
OracleDataReader
IDataReader/IDataRecord
SqlTransaction
OracleTransaction
IDbTransaction
SqlParameter
OracleParameter
IDbDataParameter
SqlParameterCollection
OracleParameterCollection
IDataParameterCollection
SqlDataAdapter
OracleDataAdapter
IDbDataAdapter
 Refer to:
http://msdn.microsoft.com/library/default.asp?url=/library/enus/dnvs05/html/vsgenerics.asp
NUnit and Team Test
 NUnit is a unit testing framework for all .NET languages.
Initially ported from JUnit, the current production release,
version 2.2, is the fourth major release of this xUnit
based unit testing tool for Microsoft .NET.
 Team Test is a Visual Studio integrated unit testing
framework and tools that enable:
•
•
•
•
Code generation of test method stubs
Running tests within the IDE
Incorporation of test data loaded from a database
Code coverage analysis once the tests have run
Composite Application Block
 Refer to
http://www.gotdotnet.com/codegallery/codegallery.aspx?id=22f72167-af9544ce-a6ca-f2eafbf2653c
Composite Application Block
Preparing .NET Code Generation
 Define O/R mapping
 Add Extended Model Definitions
 Define NHibernate, ADO .NET unit tests, WinForm
parameters in objects’ properties
• Model, classes, attributes, associations
Defining O/R Mapping using Mapping Editor
Add Extended Model Definitions
 Add the following Extended Model Definitions
• NHibernate or ADO .NET
• Unit Test
• Windows Application
Example of NHibernate Parameters
Example of ADO .NET Parameters
Generating Data-Centric .NET Applications Code
 Use Language>Generate C# or VB Code to generate
the entire code
 Compile the generated solution using Visual Studio
2005
 Run unit test using NUnit or Team Test
 Run the Windows application, use users data to test the
persistent objects
 Improve the forms
Integration with PowerBuilder
 PowerBuilder is moving to .NET
 The future version of PowerBuilder can use .NET code
in PowerBuilder applications
 PowerDesigner can help PowerBuilder developers to
better support model-driven development for .NET
Integration with PowerBuilder
 Use PowerDesigner to
• Design requirements
• Design application business objects, business logic and
database
• Support top-down and bottom-up approaches
• Generate database schema and O/R mapping
• Generate .NET code (business objects, O/R mapping)
• Use business objects for business logic implementation
 Use PowerBuilder to
• Develop DataWindows and Forms
• Integrate business objects
PowerDesigner 12.1 New Features
 Visual Studio 2005 plugin
 Support .NET 2.0 (generics, enum, partial class)
 .NET code generation (O/R mapping for ADO .NET and
NHibernate, unit tests for Team Test and NUnit, WinForm)
 Integration with Team Foundation Server
 Better support SQL Server 2005
 Reverse engineer statistics to build IQ column indexes
 Generate load scripts and insert…location scripts for IQ
 Support RepServer 15.0, ASA 10, MobiLink 10, EAServer 6.0
 Support EJB 3.0 persistence management
 Generate CRUD stored procedures
 Show generation links
 Define XML-XML mapping
 Repository proxy for performance improvement
 Update icons
Conclusion
 Using PowerDesigner 12.1 and Model-Driven
Development approach, developers can accelerate
.NET application development and improve the quality.
Thank You!
Q&A
Xiao-Yun WANG
PowerDesigner Chief Architect, Sybase Inc
[email protected]