如何组织呢?你怎么看? [英] how to organize it? what's your opinion?

查看:94
本文介绍了如何组织呢?你怎么看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我写这封信的目的是要向您询问编程方法/版本控制方法.

首先是一个简短的介绍:
我正在为机器开发软件(如果您感到好奇,请访问我的网站),该软件开发有两个主要方面:

a) HMI(Visual C ++应用程序)
b)控制软件(类似于PLC的程序,用于控制机器的输入,输出,运动……).

在PLC应用程序(b)中,我正在使用OOP环境进行开发,该环境可以使我做得很酷.在那种环境下,我有个问题.

请注意,通常在完成机器后,代码仍保持不变.

让我们自己去问这个问题:
以我为例,我编写了一个类来控制驱动器的移动,例如,我可以根据需要创建该类的实例(实例数==驱动器数).

如今,我有一个文件夹,其中存储了所有类,并将这些类复制到每个机器项目中.

这给我带来的问题是,每次更新一个类时,在不同的项目中都会有该类的不同版本.我将不得不将其更新为正在运行的多个项目(仅在需要时).

这给我带来的好处是,在完成计算机的安装后,我会获得计算机最终状态的完整副本,因此,我确定我已经安装了计算机上的代码.

另一方面,假设由于XXX驱动器制造商的规范更改而必须更改用于控制XXX的类,那么我对将这些更改自动应用到旧计算机(对于旧计算机)不感兴趣. XXX驱动器型号).

可能很有趣的是,只有一个文件夹,其中放有这些类,当出现不同的设备版本时,会制作这些类的不同版本,并从不同的应用程序链接到这些类,而无需复制它们.

唯一让我担心的是,无辜的变更会影响旧机器的行为……

您如何应对?

我可以看到双方的优势...

PS:直到今天,我一直在编程的软件仍不允许我使用集中的文件集进行开发,因此无需询问,但是现在新版本已经发布了((甚至我不确定)这是允许的)可能会出现,并且疑问已经出现.

预先感谢您的评论.

Hello all,

I’m writing this to ask you about programming methods / version control methods.

First of all a small introduction:
I’m developing software for machines (see my web site if you are curious) this software development has two big sides:

a) HMI (visual C++ applications)
b) Control software (PLC like programs that control the inputs, outputs, movements… of the machine).

In the PLC applications (b) I’m developing using an OOP environment that allows me to do really cool things. In that environment is where I have the question.

Note that typically after finishing with a machine the code remains unchanged.

Let''s go to the question itself:
In my case I program for example a class to control the movement of a drive, let’s say I can make as many instances of that class as I need (number of instances == number of drives).

Nowadays I have a folder where I’ve stored all the classes and I copy those classes to each machine project.

This gives me the problem that each time I update a class, I have different versions of that class in different projects. I will have to update it into as many projects it was working (only if it is needed).

This gives me the advantage that when I’ve finished the machine I have a complete copy of the final state of the machine and therefore I’m sure that I have the code that was installed on the machine.

In the other hand imagine that the class that controls the drive XXX has to be changed due to a change in the specs from the XXX drive manufacturer, then I won’t be interested in applying automatically those changes into the old machines (with the old XXX drive model).

What probably would be interesting is to have only a folder with the classes there, making different versions of those classes when different equipment versions appear and link to those classes from the different applications without copying them.

The only thing that worries me is that an innocent change would affect old machines behaviors…

How do you cope with that?

I can see advantages in both sides…

PS: till today the software that I’m using to program did not allowed me to develop using a centralized set of files so there has not been the need to ask, but now the new version is here and (even I’m not sure this is something allowed) probably it will and the doubt has appeared.

Thank you in advance for your comments.

推荐答案

嗨琼,
在我看来,这听起来像是源代码控制系统的理想人选.您使用最新版本维护主干",并且每次为特定机器/客户端构建时,都为该构建分支一个分支.
当您想对较旧的分支进行更新改造时,只需对分支进行相关更改即可.
我没有什么好手的参考,但是我敢肯定,您可以找到有关使用源代码控制的一些明智的讨论.

用这种方法不能解决的一个问题是您的工具链(例如编译器)发生了变化,如果以后重新编译,则相同的旧"源代码会产生不同的结果.但是,除了保留旧工具链的副本,并希望您仍然可以找到一个可以在其上运行的系统之外,没有太多方法可以处理此问题.

[免责声明:此答案是不含咖啡因的,因此可以大大改善.欢迎光临!]

干杯,
彼得
Hi Joan,
This sounds to me like a good candidate for a source control system. You maintain a "trunk" with the latest version, and each time you build for a particular machine/client, you fork off a branch for that build.
When you want to retrofit updates to older branches you simply extend the branch with the relevant changes.
I don''t have any good references to hand, but I''m sure you can find some intelligent discussions about this use of source control.

One problem that is NOT solved by this approach is a change in your toolchain (eg compiler) where the same "old" source code produces a different result if you recompile later. But then, there aren''t too many ways to handle this except for keeping a copy of the old toolchain, and hoping you can still find a system to run it on.

[disclaimer: This answer is uncaffeinated, so could be greatly improved. All welcome!]

Cheers,
Peter


这篇关于如何组织呢?你怎么看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆