安卓& Web:Web 的等效样式是什么?
开发 Android 应用程序时遵循的工作流程给我留下了深刻的印象:在 xml 文件中定义布局,然后以代码隐藏样式编写所有代码。网络上有等效的样式吗?我的意思是,是否可以使用标记语言定义预定义的小部件列表,然后使用代码控制它们?
我遇到过 Google 的 Web Toolkit 可以做类似的事情,但我也想听听其他人的想法。
I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for the web? I mean, with a predefined list of widgets that can be defined using a markup language and then control them using code?
I have come across Google's Web Toolkit that does something like this but I'd like to hear what other's think as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我知道这是一个相当古老的线程,但如果你现在还没有尝试过,Wicket 就是这样。我以前从事 Android 的 wicket 开发工作,它让开发工作变得更加容易。完全相同的概念。使用 HTML 定义您的 UI,然后您需要任何控制逻辑的任何 html 对象,您可以设置一个 Wicket ID。然后在 wicket java 文件中,编写引用已设置的 html wicket ID 的逻辑。它有大量预定义的小部件,可以在幕后处理如此多的事情。这是我处理过的最好的网络框架之一。
I know this a fairly old thread, but if you haven't tried it by now, Wicket is exactly like this. I came from doing wicket development to Android and it has made it tons easier. Exact same concept. Define your UI with HTML and then any html objects you need any control logic on, you set a Wicket ID. Then in a wicket java file, you write your logic referencing the html wicket ID's that were set. It has tons of predefined widgets that handle so much behind the scenes. It's one of the best web frameworks I've dealt with.
使用 Visual Studio 尝试 ASP.NET。无需 XML!添加 MVC 框架,您就进入了天堂。
Try asp.net with Visual Studio. No xml needed! Add the MVC framework, and you're in heaven.
PHP 框架: http://www.pradosoft.com/
PHP Framework: http://www.pradosoft.com/
Google web 工具包的工作方式与您所描述的方式有些相似,尤其是即将推出的 2.0 版本,它将允许在 html/xml 中定义布局,而不是添加 java swing 风格的小部件。
正如 Benji 所说,Asp.net 的工作原理正是如此。
就我个人而言,我更喜欢 MVC 方法而不是代码隐藏方法。
Google web toolkit works somewhat in the manner you're describing, especially the 2.0 version that's coming out, which will allow defining the layout in html/xml, rather than java swing style widget adding.
And as Benji said, Asp.net works exactly like this.
Personally, I much prefer an MVC approach over a code-behind approach.