关于导出到 MS Project 的架构问题

发布于 2024-08-13 02:45:02 字数 554 浏览 12 评论 0原文

我有一个小型的 asp.net Web 应用程序,允许您创建项目和任务并对它们应用估计、工作等。我正在编写一个导出功能,以便您可以将它们下载为 MS Project 文件。它实际上只是一个 XML 文件。

之后我将编写一个导入功能,它允许您重新安排任务开始和结束日期、分配的资源等,但不能修改估计或应用的时间。这将仅由网络应用程序处理。

我正在尝试找出实现此目的的最佳架构。这是我正在考虑的几个想法。

  1. 在我的 Project 类中添加 ExportToProject 函数,并动态创建 XML。
  2. 采用现有的类结构并添加 XML 序列化器属性,并将对象直接序列化到项目文件中。然而,这给我留下了几个问题。我没有使用的所有其他属性会发生什么情况。如果序列化对象不包含所有数据并且针对 MS Project 进行格式化,那么它的可重用性如何。可以这么说,我可以有多个序列化视图吗?
  3. 创建一个新的 XmlExport 类来进行序列化,这与上述策略类似,但具有额外的抽象层。
  4. 盗版 FogBugz 的副本,安装它,然后搬到哥斯达黎加。

谢谢,非常感谢任何帮助。

I have a small asp.net web application that allows you to create Projects and Tasks and apply estimates, work, etc to them. I am writing an export feature to allow you to download them as an MS Project file. It's really just an XML file.

I will be writing an import feature afterwards, which allows you to reschedule Task start and stop dates, the assigned resources, etc, but not modify estimates or applied hours. That will be handled solely by the web application.

I am trying to figure out the best architecture to do this. Here are a couple ideas I'm toying with.

  1. Add an ExportToProject function on my Project class, and create the XML on the fly.
  2. Take the existing class structure and add XML serializer attributes, and serialize the object right into a Project file. However, this leaves me with a few questions. What happens to all of the other Properties I'm not using. How reusble would the serialized object even be if it doesn't include all of the data, and is formatted for MS Project. Can I have multiple serialize views, so to speak?
  3. Create a new XmlExport class that gets serialized instead, which would be similar to the above strategy, but with an additional layer of abstraction.
  4. Pirate a copy of FogBugz, install it, and move to Costa Rica.

Thanks, any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

第几種人 2024-08-20 02:45:02

我会使用 3. 或 1b。这使您有机会随时更改内部结构,而不会出现任何并发症。

1b.将是:创建一个能够动态创建 XML 的导出器类。但不要将该导出器放在您的 Project 类中,而是放在一个单独的类中。这也是一个额外的抽象层。

I would use 3. or 1b. This gives you the chance to change your internal structure at any time without complications.

1b. would be: Create a Exporter Class which is able to create XMLon the fly. But do not locate that exporter in your Project class but in a separate one. This is also a additional layer of abstraction.

我乃一代侩神 2024-08-20 02:45:02

不要自己动手,而是使用 MPXJ,它提供了一组方便的 .Net 和 Java图书馆。它读取所有类型的 MS Project 格式并写入 .MPX 和较新的基于 XML 的文件格式。

它是一个基于 POI 的强大库,将为您节省大量工作。

Instead of rolling your own, use MPXJ which provides a handy set of .Net as well as Java libraries. It reads all types of MS Project formats and writes to .MPX and the newer XML based file formats.

It's a robust library based on POI and will save you a lot of work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文