code-generation

Flex Code Generator based on XML or Database Structure

I don't know if it exists some code generation method for Flex based on XML or Database Structure. For example, we want to manipulate a table in the DB, the most common task is (View/Insert/Update/Delete). And when we have more than 100 fields on the interface, it's rather boring to type them manually in Flex. Is there some ways to gene...

Effect of unused methods and properties on library or executable

I'm playing around with creating a source code generator for C# (.NET). Will generating properties or methods that never get called cause my code to run slower? How about inserting "using" statements for libraries that don't get used? I'm assuming the compiler is smart enough not to build in the unused "using" statements, but there is n...

What all Design Patterns can I use ?

1. I need to build a "Web Service Server (Simulator)" which generates the xml files and also sends async calls to the client for notification. At this point, I am writing a code to generate dummy XML files which will be used for testing (FileGeneratorClass-- builder)? 2. Also, can I implement this in a way that I do not have to write a...

Generate C# automatic properties with Codedom

is there a way Generate C# automatic properties with Codedom or maybe an other set of libreries that i can use ? ...

Why does Visual Studio use xchg ax,ax

I was looking through the disassmbly of my program (because it crashed), and noticed lots of xchg ax, ax I googled it and found out it's essentially a nop, but why does visual studio do an xchg instead of a noop? The application is a C# .NET3.5 64-bit application, compiled by visual studio ...

Generating sources by running a project's java class in Maven

I'm converting a largish Ant build to Maven. As part of the Ant build, we have several steps which created Java classes by invoking one of the project's classes, simplified as: javac SomeGenerator.java java SomeGenerator generated # generate classes in generated/ javac generated/*.java I've split each generator in its own Maven modu...

What should be returned when inserting into SQL?

A few months back, I started using a CRUD script generator for SQL Server. The default insert statement that this generator produces, SELECTs the inserted row at the end of the stored procedure. It does the same for the UPDATE too. The previous way (and the only other way I have seen online) is to just return the newly inserted Id back ...

C++ forward class declaration generator

Is there a tool that would go through a list of files and would spit out a header file with forward declarations of classes it encounters? Ideally, I would like to integrate it into Visual C++'s build process. ...

Generating pass-through code when "preferring composition over inheritance"

Problem Let's say I'm trying to model a cell phone as a combination of a regular phone and a PDA. It's sort of a multiple inheritance scenario (a cell phone is a phone, and it is a PDA). Since C# doesn't support multiple inheritance, this pretty much calls for some kind composition. Plus, let's say that I have other reasons to favor com...

Code generation from WSDL using XML Catalog

Is there any tool for generating Java code from WSDL using XML Catalogs? The problem is that I have wsdl files that import XML schemas which also import other schemas and the schemas are not available at schemaLocation url. That is why code generation fails. If a tool was able to use XML Catalog this problem would be solved without modif...

Code generator for SQLite and .Net

What code generator tool you are using for SQLite and .Net ? ...

Why does SvcUtil create a Channel interface that derives from IClientChannel

When you create code from a WSDL file using SvcUtil.exe, among the many types created is an interface that derives from both the service interface and IClientChannel. If, for example, the created service interface is called IMyService, it also creates this interface: public interface IMyServiceChannel : IMyService, System.ServiceM...

Need to generate EDMX files and compile them

Hi All, My question might be little bit different or basic for advanced users here. I have a web application which is customizable by administrators. This means, the admin can add new table schema or edit table columns, add new table columns etc. These changes are mapped to our logical objects (much similar to EDMX) which is publishe...

Patching gcc, Adding memory write to a sparc fsqrts insn

I'd like to patch gcc's sparc machine description so that the destination register of a FPU sqareroot operation fsqrts is stored into memory after each fsqrts. like this: fsqrts %f2,%f4 st %f4, -4[%fp] <= add this after every fsqrts where -4[%fp] is a slot allocated on the stack for each fsqrts insn The s...

Is there any way to control where the output file of a T4 is generated to?

I would like to generate C# code for silverlight but I dont have access to some dll's that would make my T4 code more powerful. Is there anyway to have my T4 template in a C# Class Library and have it generate a file in the Silverlight Class Library? ...

Generating F# code

T4 is the "official" code generation engine for C#/VB.NET. But F# doesn't support it (this is from April, but I couldn't find any newer mentions). So what is a good way to generate F# code? EDIT: I want to implement 2-3 finger trees in F#. I already have implemented them in C#, so this should be a nice comparison. The "digits" and node...

Having an issue with Nullable MySQL columns in SubSonic 3.0 templates

Looking at this line in the Settings.ttinclude string CheckNullable(Column col){ string result=""; if(col.IsNullable && col.SysType !="byte[]" && col.SysType !="string") result="?"; return result; } It describes how it determines if the column is nullable based on requirements and returns either "" or "?" to the ge...

Is there any way to have functions in basic T4 templates?

By basic T4 template, I mean not using T4 Toolkit or any of the add-ins. My T4 is getting a little complicated, but I'd like to keep in self-contained for now. Is there a way have functions in your T4 template, without referencing external assemblies? ...

Best design for generating code from an AST?

I'm working on a pretty complex DSL that I want to compile down into a few high level languages. The whole process has been a learning experience. The compiler is written in java. I was wondering if anyone knew a best practice for the design of the code generator portion. I currently have everything parsed into an abstract syntax tre...

C# code generation tool

I'm looking for a tool that can do scripted code generation for me on the .NET platform. ...