code-generation

Java: library for simple source code re-creation / copying

I am looking for a library which would simplify the process of copying parts of the code from one project to another. Copying of certain parts of the code which belong to the same file is not required. I am aware that there exists some code generators which would enable me to build the generated code from scratch programatically, but I a...

How can I generate code when compiling?

There are some tools, like PostSharp, that generates code when compiling. How is it done? Can anyone provide some simple example? ...

A code generator for java available for maven?

Hello, I am developing a java project with maven which generates code files. I am looking for a good code generator that is available for maven. So far I tried <plugin> <groupId>com.tikal.maven</groupId> <artifactId>tikal-maven-jet-plugin</artifactId> <version>0.3.0</version> The advantage of this plugin is that it genera...

Is there any Castle ActiveRecord generator from Visual Studio 2010 Modeling Project?

Hi all, Visual Studio 2010 includes a Modeling Project that lets to create UML diagrams like class diagram. We have plenty of class diagrams in VS 2010 Modeling Project and wish to generate Castle ActiveRecord classes from them. I have searched and found many tools like ActiveWriter, MyGeneration, Active-Record-Gen, The DarkSide, Gener...

Code OnTime ASP.Net code generator

Hi Does somebody tested Code OnTime on a real world project (codeontime.com)? Technology looks promising, but their free version restrictions are too restrictive. I managed to put only few tables in a model, real DB has 20+tables. Also it is not clear how generated site works where DB contains lot of records. To my surprise I didn't fin...

VS: cursor position when override method is generated

My cursor (the pipe) is inside the body of the child class. public class BarContext : FooContext { | } I type "override" and press tab to view a list of methods in FooContext which I can override. "Context" is one of the options, so I select that. public class BarContext : FooContext { protected override void Context() { ...

How do you force Eclipse to prompt you to create a getter and setter when it doesn't do it automatically?

I added two private fields to my Java class. Eclipse prompted me to automatically create a getter and setter for one of them. How do I get it to do the same for the other one that it 'forgot' about? ...

Problem with web code generator designer

I want to write a web-based code generator for a Python crawler. Its aim is to automatically generate code so a developer doesn't need to write it, but I've run into this problem: in one of my project's webpages, there are some checkboxes, buttons, etc. Each of them generates some Python code and writes it to a common textarea. However, ...

Change Generated C# Class Name

I am using ManagementClass.GetStronglyTypedClassCode to get a reference to CodeTypeDeclaration instance. I would like to change the generated class name and this method doesn't allow for this (as far as I can tell). I have tried to change the CodeTypeDeclaration.Name property, but this doesn't change constructor names etc, so the C# comp...

LINQ DAL Generator.

Hi. Is there any software or provider or framework exist that able us to generate DAL layer with Linq To SQL? thanks. ...

Expand object oriented code

Are there any tools that will expand object oriented code so there is no sharing of any kind? For example if I have two classes A and B which inherit C then the tool would adjust classes A and B to no longer use C. It would also be nice if the tool did this and it still compiled and produced the same results. I think the main difficulty ...

Ruby/Python - generating and parsing C/C++ code

Hi, I need to generate C structs and arrays from data stored in a db table, and alternately parse similar info. I use both ruby and python for this task, and was wondering if anyone heard of a module/lib that handles this for either/both languages? I could do this on my own with some string processing, but wanted to check if there's a k...

Naming convention for generated identifiers in C#

In a lot of autogenerated code in Java, the common practice is to preface the name of variables that could potentially clash with user variables with a dollar sign. By convention, manually written code doesn't use dollar signs. However, in C# that character isn't valid in identifiers. Is there a standard practice for naming generated ide...

Dynamically create a class in C#

I have a class which looks like this public class Field { public string FieldName; public string FieldType; } Based on an object List<Field> with values {"EmployeeID","int"}, {"EmployeeName","String"}, {"Designation","String"} I want to create a class that looks like this: Class DynamicClass { int EmployeeID, Str...

List of UML state-machine diagram to (Java) Code (Generation) Software

I’m looking for software / UML tools that can generate code (including, or not, Java) from UML state machine diagrams. Be it from diagrams modeled in the tool itself or imported as XMI or whatever. For example, Visual Paradigm Enterprise Architect (supposedly) can do this. Do you know any other tools? ...

Code generator to create ADO.NET SqlParemeter array from stored procedure inputs?

I have SQL Server stored procedures which have several inputs. I want to save time from manually creating C# ADO.NET sqlParameter arrays as in sqlParameter[] sqlParameters = { new SqlParameter("customerID", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, string.Empty, DataRowVersion.Default, custID) ....... ...

How to prevent duplicate code generation when placing winforms event handlers in other partial files

In a winforms application I have a MyForm.cs that starts to get quite large. To solve this I have created a new file(MyForm.LeftPanel.cs) using partial class of the MyForm class with a subset of the GUI functionality. However once in a while, not always, when I go into the designer all event handlers that I have moved to MyForm.LeftPane...

Customising Sharp-Architecture Code Generation WizardImplementation

Hi, I have a solution where I have two web projects instead of one. One for front-end and one for the back-end. Now, I am running into problems when I try to generate code as it looks for the default Web project WhatEverTheSolutionName.Web But I don't have it as I renamed it to WhatEverTheSolutionName.FrontEnd.Web and also created anoth...

Mock/fake test data generator into NET classes

Does anyone know of a test data generator that will create the code to populate a .NET collection class which can then be copied into a unit test? Searching this site, all the tools mentioned seem to hit databases and I already have Red Gate's SQL Data Generator for that task. However if one follows the TDD paradigm and/or model first d...

how to achieve calling a function dynamically, thats right the function to be called is decided from database values, using c#

the application is very large so giving a brief back ground and the problem when the user logs in, a button is displayed having the text of the function he is allowed to call. the function he is allowed is mapped in the database table its made sure that the name of the actual function is same to the ones used in the db. problem the ...