English 中文(简体)
2. Java 结构变化与以往的经历
原标题:Java Structural change with Facade pattern

I m trying to restructure some specific GUI code in a Java project, let s call it Project A, by removing dependencies from the project and moving the code to an existing API. I have another project which requires basically the same features/interface, and I d like to reuse these capabilities in that other project.

I have read about the Facade Design Pattern in the Design Patterns book by the GoF, and thought that it may be applicable here.

在阅读法学院模式之前,我试图撰写一个称为IMessagePasser的接口,该接口只是用接口方法取代任何项目特定代码,作为每个客户(例如项目AMessagePasser)执行的合同。 这似乎涉及法学院的半数,使《全球倡议》的代码移至APIC。

接下来的一步是与A项目相同,通过在项目AMessagePasser中增加更多的方法取代全球倡议的附属部分,以便基本上说明项目BMessagePasser与全球倡议代码之间的必要通信。

在大规模调整法典方面,我没有很多经验,但这似乎都是合理的? 如果不首先作出所有变动,我就很难说话,如果能够做得更好的话,我不想浪费很多时间去做。

最佳回答

为了使其更易于管理,你可能希望为评估的功能领域提供服务,并集中支持。 在你到场时,撰写单位测试,验证功能。 一旦你具备服务功能,你就可以在这些服务周围建立学院。

换言之,分裂和征服的可能性可能比较容易,而不是一劳永逸地重归所有。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签