大型项目.您将如何编写课程. [英] Large project. How would u write the classes.

查看:82
本文介绍了大型项目.您将如何编写课程.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写程序,可以从类中获得一些启发.
该模式已经存在(使用mvp,因为他们希望在大约一年内同时扩展到网站和电话).具有数据和业务层.

背景信息
但这是关于制造卡车拖车的.
因此该程序包含四类拖车.
一部预告片包含约200种规格.

问题
现在,我正在使用大约35个用户控件,因此我可以重复使用它们.
它们都可以使用组合框,因此您可以在组合框之间进行选择.
快速示例:
U有轴,不同的后门,保险杠,尺寸.
后门包含每个组合框来自6个表的数据.
组合框数据源,值在表格中以及车辆数据.
该显示成员位于每个不同的表中,并且它们之间具有关系.

可能的解决方案
每个表都有一个类.然后为实现它的每个用户控件都提供另一个类.
然后是一堂预告片.
但这有很多类吗?

还有其他建议

预先感谢

I''m writing a program and I could use some inspiration with the classes.
The pattern is already in place (using mvp because they want to expand to both website and phone in about a year). With a data and a business layer.

Background information
But it''s about making trailers for trucks.
So the program has four catogories of trailers.
One trailers contains about 200 specifications.

Problem
Now I''m using about 35 user controls, so I can re-use them.
They all work with comboboxes so u can just choose between it.
Quick example:
U have axles, Different back doors, Bumper, Measurements.
The back door contains data from 6 tables for each combobox.
The combobox datasource, value is in the table with the data of the vehicle.
the display member is in each a different table with a relation between it.

Possible solution
Have a class for every table. Then have another class for every usercontrol where you implement it.
Then 1 class for the trailer.
But that is alot of classes?

Any other suggestions

Thanks in advance

推荐答案

是的,您可以采用起草的路径.该项目的目标是什么?我想,您想通过从预定义的参数中进行选择,向客户提供构建自己的拖车的方法.对?但是您想从我们这里得到什么?建议如何将此业务模型转换为数据模型?假设吧.

我认为模型空间小于所有可能分量的笛卡尔乘积-可能存在排除项.
我不会将组件存储在不同的表(类)中,而是使用单个实体,该实体将包含名称,id,组件种类,如果需要存储有关其的不同参数信息,则将动态部分映射到XML(或JSON字符串,或简单格式化的文本,具体取决于平台).在另一个表中,您可以存储排除项.

使用这种方法,您不受组件数量的限制,该数量可以根据业务需求而增加或缩小,并且不得更改代码.但是您将需要在运行时创建下拉列表以及其他可能的控件.但这应该不是问题.

这只是我要使用的一种方法,可以(应该)根据实际业务需求进行完善.
Yes you could take, the path you drafted. What is the goal of the project? I suppose, you want to deliver means to the customer to build it''s own trailer, by choosing from predefined parameters. Right? But what do you want from us? Suggestions how to translate this business model to data model? Let''s suppose that.

I assume, that the model space is smaller than the Cartesian product of all possible components - there could be exclusions.
I would not store the components in different tables (classes), I would use a single entity, that would contain a name, id, component kind, and if it is needed to store the different parameter information about it, a dynamic part mapped to an XML (or a JSON string, or a simple formatted text depending on platform). In an other table you could store the exclusions.

Using this approach, you are not limited by the number of components, this number can grow or shrink according to the business needs, and the code must not be changed. But you would need to create dropdowns, and possible other controls at runtime. But this should not be a problem.

This is only an approach that I would use, that can (should) be refined based on the actual business needs.


这篇关于大型项目.您将如何编写课程.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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