code-generation

Auto generating DAL in an ASP.NET application

Given a stored procedure, is there a way to auto generate a Data access layer? I understand that this can be done using Codesmith by creating cs templates, but was wondering if there's a free/paid solution out there. The plan is for the architecture to have: ASP.NET code behind -> Business Layer -> Data Access layer -> Stored Procedure...

java classloader and runtime compilation

Hi all, Despite warnings to drop my present course of action, I currently see no better way to solve my problem. I must generate Java code at runtime, then compile it, load it and reference it. Problem is that the generated code imports code that has already been loaded by the system class loader (I suppose) - that is, code present in ...

Visual Studio overwriting UserControl parent when not inheriting System.Windows.Controls.UserControl

I am creating a series of UserControls that all have some similar business logic. So I tried to implement this common business logic in an abstract base class that all of these user controls would inherit from. The inheritance chain looks something like this: System.Windows.Controls.UserControl <-- MyControlBase (abstract)<--MyControl1,...

Is it a bad idea to auto generate javascript code from the server?

I'm developing a facebook app right now all by my lonesome. I'm attempting to make a javascript call on an onclick event. In this onclick event, I'm populating some arguments (from the server side in php) based on that item that is being linked. I'm inserting a little bit of JSON and some other stuff with funky characters. Facebook expe...

Is there a Java parser for the Java language?

I'm looking for a java library that allows me to parse a java source file and that gives me an AST representation of the code. Actually I'm only interested in the class and method definitions with their annotations. I don't need the AST of the method code. I'm using this information for code generation. This is why I can't compile the ...

What tools are available to auto-generate ASP.NET MVC REST services from domain objects?

I am developing an application for which I want to expose the basic CRUD operations on most of the database entities through REST web services. A colleague has demonstrated some impressive code generation using Grails. I would like to be able to generate my REST services as well, but using ASP.NET MVC instead of Grails. I planning on u...

Easy way to extract documentation from Ecore files

I am trying to extract the packagenames and classnames AND documentation and notes stored in my Ecore-files for including them in external documents (Wiki, Word, etc.) Are there any easy to use tools for doing this or will I have to write my own XSLT-transformation or setup an oAW-project to do this? If there are no end-user friendly t...

How can I convince Visual Studio to not omit access modifiers when generating code?

Very often when Visual Studio generates code (for example generating an event handler stub) it omits access modifiers for members. I would like it to stop doing this. Is there a setting for this? ...

NHibernate Code Generation

Hi All, I am working with NHibernate, and a few code generation tools. MyGeneration is one and SmartCode is the other. This question has been asked before, but I have looked at some other responses and found that the code generation tools in the nHibernate space to be pretty poor. I might be able to get away with MyGeneration and Smar...

.Net class generation from XSD with union

I've been working to create classes representing the HR-Xml 3 spec for the stand-along packages related to Screening. I've had a couple of problems, but currently I believe the main problem is the lack of support within xsd.exe for the xsd:union statement. When Xsd.exe encounters a simple type defined by union, it ignores the d...

SubSonic 2.2 SqlQuery object generates very different sql for WHERE...IN statement for SQL Server 2008 and SQL Server 2005

Does anybody have an idea why SubSonic 2.2 SubSonic.SqlQuery object would be generating very different sql for the same C# code when running against SQL Server 2005 or SQL Server 2008? I have a site that's been running for a while on SubSonic 2.2/SQL Server 2005. I just upgraded the DB to mssql 2008 and am encountering the following er...

How to read Dbml file and map it into an object model in .net?

Im planning to write a code generator to generate UI (forms, grids, etc.). Since i'm using Linq i'm planning to read dbml file for metadata extraction purposes. I wonder if there is some Api to read the Dbml object model (database, tables, columns, asociations). I've opened SQLMetal.exe with Red Gate's .NET Reflector, it contains a nam...

Creating Java stubs for a DLNA service / client? (or, What the hell is a <scpd> root tag in an XML file?)

Looking at the specifications for DLNA, most of the metadata communication appears to be soap based. However I can't find anything like a WSDL for any of the various services. Instead there is some sort of service description language that looks like this: <scpd> <serviceStateTable> <stateVariable> <Optional /> <name...

PHP class generator for web services

Hello, I am trying to find some kind of php class generator for Web Services (WCF service if that matters) without any luck so far. Any ideas? thanks ...

Simple & Practical C# code generation (VS 2008 or 2010)

I've put off using generated code as part of the build process for fear of the complexity it introduces into the build process. Is there a simple way to integrate build-time generated code into an app? The kind of code I'm thinking of is similar to the resource and settings file code generation that Visual studio performs: Having int...

Language Agnostic API Generation

I am currently working on a design for a collection of subsystems, and I would like to be able to offer the API's exposed by a given subsystem for use by other subsystems. In the past, I have used SWIG to expose C api's to a variety of other languages. This has worked well for me, but ultimately the API is defined in C. So basically one...

What are the disadvantages of using backend generated Javascript or CSS?

Just curious. My thought is that generated files have negligible overhead in terms of performance but I could be mistaken. Any thoughts on this? ...

What do you use code generation for in .NET?

what do you use code generation for? what are the typical scenarios that allow to get real value out of on-the-fly run-time c# code generation? Specifically: what do you use CodeDOM namespace for? ...

synthesize getters/setters in AS3

Hi, Is there a way to synthesize getters/setters in AS3? It's very common that you have a class with lots of variables, especially in math calculations (Model in MVC pattern), that you'd like to expose. Is there something like synthesize property in Objective-C, that allows to generate getters/setters? Thanks, Nava ...

generate web based database front end

I've created a database schema for an internal (CRM like, ~15 tables) application. I would like to "convert" this schema to a usable web application. All details (foreign key, ordinality etc) can be extracted from the schema so I'm looking for a tool that will generate all CRUD code (that can be hosted on a Linux server). Any suggestions...