Sunday, December 14, 2008

Artorius: абстрактному синтаксическому дереву(AST) быть в NHibernate.

В репозиторий неофициальных дополнений к NHibernate одним из его ведущих разработчиков Fabio Maulo был добавлен проект Artorius. Проект призван решить давнюю проблему - отсутствие  абстрактного синтаксического дерева внутреннего языка запросов. В текущей версии обе основных технологии запросов HQL и Criteria API используют свои уникальные методы трансляции в SQL. Предполагается реализация внутреннего nHQL-AST, именно в который и будут преобразовываться запросы созданные с помощью доступных технологий: HQL( имеются ввиду строковые запросы), Criteria API, LINQ или любого другого языка запросов(кроме нативного SQL).

На текущий момент в репозитории есть определенние грамматики HQL в форме Бэкуса — Наура и реализация ast, при создании ast из строки hql используется модифицированный парсер GOLD:

image

Все тесты проекта на данный момент  направлены на тестирование грамматики, но как видно по коду разработка самого дерева тоже уже ушла  достаточно далеко, что позволяет сделать вывод: ast в NHibernate быть.

Tuesday, December 2, 2008

Visual Studio Team System 2008 Database Edition GDR - RTM

Visual Studio Team System 2008 Database Edition GDR - RTM - очень полезная новость, для тех кто разрабатывает для SQL Server в этой среде(я отношусь к этим людям). Поскольку это практически новый релиз инструмента, в нем очень много новых(недостающих) возможностей. Всем кто с ним работает советую "обновить" (установить) версию.

Feature list

  • Project System
    • Full support for SQL Server 2000, SQL Server 2005 and SQL Server 2008 support.
      • All database objects are now modeled, therefore they are compared and part of deployment. The side-effect of this is that there are no more objects that need to be stored in pre- and post-deployment scripts.
    • Server vs. Database projects
      • This change allows you to model the different behavior of shared and server level objects inside SQL Server vs. user database level objects. 
    • Partial projects
      • Partial project allow you to share implementation between projects, with a single definition of the code
    • Composite projects
      • Composite projects extend database references, allowing you to add objects from other project to the name database schema namespace. So you can compose your database from other projects and/or DBSCHEMA file references
    • Database references using literals, in addition to SQLCMD token support
      • The addition of literal support facilitates that you do not have to change your code of 3-part names, when do do not require the flexibility of name independent deployment
    • Reference support for XML Schema Collections to include .XSD files
      • Enables single sourcing of XML Schema Collections from an .XSD file which itself can be used by other developers or tools.
    • Reference support of SQL-CLR projects and / or SQL-CLR assemblies
      • Enables the inclusion of a SQL-CLR project or a binary, to represent a SQL-CLR assembly. Like XSD references, the goal is single sourcing of artifacts inside the development environment
    • Import Schema and Import Script is now available through DTE
      • This allows the creation of macros or programmatic add-in to drive these common tasks.
    • No more "DesignDB"
      • The change to a fully model driven implementation makes the need for a local SQL Server database instance obsolete. Having a sandbox for your development environment is still am advised practice though, so you can test the changes independently and in an isolated environment.
  • Build
    • Build validates the consistency of the schema model and produces all the files that you need to deploy the database
  • Deploy
    • Deploy takes the output from the build stage and deploys this information based on the settings supplied
    • Deployment settings are now isolated in to the .SQLDEPLOYMENT file, which allows you to standardize and re-use the deployment settings
    • Most of the "Schema Compare" comparison options are now available as the deployment options, to increase the symmetry between the two
    • VSDBCMD.EXE, is a command line deployment tool, which enables the standalone deployment of Database Project
  • Schema Compare:
    • Compares any combination of live databases, Database Projects and .DBSCHEMA files
    • Session level option support, which can be persisted and re-used
    • Object type level filtering allow you to exclude object types from the comparison
    • You can now quickly navigate back and forward between difference via the toolbar and optionally configurable keyboard shortcuts
    • Substitution of SQLCMD variables, allows for the comparison of projects that rely on the use of SQLCMD variables
    • Schema Compare can now be executed through DTE
  • Data Compare
  • Refactoring:
    • New refactoring types: Expand Wildcards and Fully-qualify Names (in addition to Rename, Move Schema and 3/4 part name refactoring)
    • The patented "preservation of intend" functionality makes is possible that the Deployment Engine will deploy renames and move schema operations as actual renames and move schema operations, instead of a DROP / ADD operation.
    • Extensibility enables the creation of your own refactoring types (operations) and refactoring targets.
  • Database Unit Testing
    • Added support for SQL Server 2008
  • Data Generation
    • BulkCopy based inserts in addition to the existing INSERT data sync
    • Sequential Databound Generator is now included in the product
  • T-SQL Static Code Analysis
    • Execute analysis using MS Build and/or as part of the VS IDE build process
    • Including the ability to write you own T-SQL Static Code Analysis rules
  • Extensibility
    • Public full fidelity .NET based T-SQL parser for SQL Server 2000, 2005 and 2008.
    • Public .NET based SQL Script DOM, for programmatically generation of SQL code (equivalent to the Code DOM in .NET)
    • Access to the Schema Model from within Visual Studio, this enables for example ability to write code generators based on the schema model.
    • Feature extensibility:
      • T-SQL Static Code Analysis rules
      • Refactoring types, these are the refactoring operations
      • Refactoring targets, these are the sources that you want to update as part of a refactoring operation
      • Data Generators
      • Data Distributions
      • Test Conditions

Monday, December 1, 2008

Ресурс на тему паттернов, антипаттернов и рефакторинга.

SourceMaking - ресурс, посвященный аспектам разработки программного обеспечения, перечисленным в названии темы сообщения. Таких ресурсов немало в сети, но на этом информация хорошо структурирована и красиво оформлена.

Улыбнули изображения категорий антипаттернов:

 

 

                    Антипаттерны разработки

 

 

 

 

 

 

                    Антипаттерны архитектуры

 

 

 

 

 

 

                    Антипаттерны управления проектом

 

 

 

Не могу не согласиться с Дмитрием Лобасевым: "Ребята здорово постарались!".