code-generation

Do you still use UML? How? What for? [closed]

僤鯓⒐⒋嵵緔 提交于 2019-11-29 20:45:36
Few years back everybody in our shop was crazy with UML . Now everybody seems to have cooled off. I am curious if there is still widespread use of UML in software projects. If so, is this usage limited to whiteboarding? Do you use it for documentation? Do you use tools to generate code from it? Related: Is UML Practical? I prefer the agile adoptation of UML (e.g. white board sketches) over the waterfall adaptation of UML (e.g. excessive documents of elaborate diagrams drawn in Visio). UML is still useful for explaining a design to someone else. E.g. the composite design pattern is easy to

JPA java code generation

♀尐吖头ヾ 提交于 2019-11-29 19:45:15
I am specifically looking for JPA code generation technique First, what are all the project could generate JPA compliant code? (Eg. HibernateTools) Second, I would also like to customize the code generation utility, as it has to compliant to our corporate standards. If not, what are all the framework available to generate java code using reflection? so I can write from scratch. Note: I used eclipse to generate JPA code and refactor it repeatedly to make it compliant. I also have difficulties understanding the question, but I'll try to rephrase: You have a lot of data in a DB and want to access

Atomic operations and code generation for gcc

自古美人都是妖i 提交于 2019-11-29 17:11:08
问题 I am curring looking at some assembly generated for atomic operations by gcc. I tried the following short sequence: int x1; int x2; int foo; void test() { __atomic_store_n( &x1, 1, __ATOMIC_SEQ_CST ); if( __atomic_load_n( &x2 ,__ATOMIC_SEQ_CST )) return; foo = 4; } Looking at Herb Sutter's atomic weapons talk on code generation, he mentions that the X86 manual mandates to use xchg for atomic stores and a simple mov for atomic reads. So I was expecting something along the lines of: test():

Free/Open Source Test Generator for Java? [closed]

霸气de小男生 提交于 2019-11-29 16:55:23
问题 Are there any libraries for Java that can generate unit tests or unit test skeletons for existing code? I'm looking for something similar to pythoscope. Ideally it would generate code that follows JUnit4 or TestNG conventions. It looks like Agitar does something like this, but I'm looking for something free. 回答1: Most IDEs will generate test method stubs for any class. I know Eclipse will. New->JUnit Class then you tell it which class you're testing and what methods you want to test. 回答2: My

How to make Xcode automatically conform to a protocol

左心房为你撑大大i 提交于 2019-11-29 16:50:25
问题 When I use a prototype table view, I always have to conform to the protocol TableViewDataSource . I always forget what methods I need to implement, so I have to look at the source of the protocol every time. This is really time consuming. I think Xcode must have a feature that automatically implements the needed methods for you, right? Just like IntelliJ IDEA, Eclipse, and Visual Studio. I want to know where can I find this feature. If there's isn't, is there a workaround for this? At least I

How should I unit test a code-generator?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 16:26:08
问题 This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I developed this code I did it using TDD, but I've found my tests to be brittle as hell. Because each test essentially wanted to verify that for a given bit of input code (which happens to

Elegant way for C++ code generation

末鹿安然 提交于 2019-11-29 16:26:05
问题 I am currently working on a database related project in which I generate a lot of C++ code. This code is compiled then and loaded as a dynamic library. I use this techniques to build efficient code for the database schema and queries. Currently, I am using simple file write to generate the code (what was okay for the proof-of-concept implementation). Now, I am searching for a more elegant but comparable flexible solution to generate C++ code. I searched quite a lot but all the solutions I

Axis2 Web Service Client Generation - Types without modifying the client

落花浮王杯 提交于 2019-11-29 15:42:56
问题 Is it possible with Axis2 and Eclipse to generate a Web Service client and have it use java types that you already have in packages instead of creating it's own types. Reason being of course if I have type A already created and it creates it's own Type A I can't just assign variable of type A to variable of type B. The wsdl is being generated from a Web Service deployed to an application server. If it's not possible to generate it from that would it be possible to generate a client from the

is there a better way to handle RPC_E_CALL_REJECTED exceptions when doing visual studio automation?

岁酱吖の 提交于 2019-11-29 15:08:20
问题 this is what I'm currently doing: protected void setupProject() { bool lbDone = false; int liCount = 0; while (!lbDone && liCount < pMaxRetries) { try { pProject.ProjectItems.Item("Class1.cs").Delete(); lbDone = true; } catch (System.Runtime.InteropServices.COMException loE) { liCount++; if ((uint)loE.ErrorCode == 0x80010001) { // RPC_E_CALL_REJECTED - sleep half sec then try again System.Threading.Thread.Sleep(pDelayBetweenRetry); } } } } now I have that try catch block around most calls to

Petri net drawing and code generation

爷,独闯天下 提交于 2019-11-29 14:46:09
问题 Is there any software for drawing a Petri net and generating any source code from there? The source code could be in any already known programming language... Slightly less desirable option would be outputting a file with only the description of the Petri net graphs in a text-based file in some open format, like XML or any other data language. I could then write the code generator myself, but at least I would like to avoid gui/graph development part ;)) Thanks 回答1: Check PetriNetSim it is