TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do you go about designing / redesigning a framework API?

1 点作者 The_Amp_Walrus超过 4 年前
<i>CONTEXT</i><p>I work in disease modelling with some epidemiologists where we&#x27;re looking into diseases like COVID-19 and tuberculosis.<p>My boss has built a compartmental modelling framework which we use for all of our team&#x27;s research and forecasts. It was originally implemented in R and has since been reimplemented in Python and then reworked significantly. Here it is if you&#x27;re curious (the framework part is under &quot;summer&quot;): https:&#x2F;&#x2F;github.com&#x2F;monash-emu&#x2F;AuTuMN<p>We want to make it easier for other researchers to use our framework, which requires a much nicer API. As the person who has the best understanding of the internals, I want to make significant breaking changes to the API because it&#x27;s clunky and unintuitive.<p>There are now quite a few models that depend on the framework and making any major API changes to the existing code would be like changing the tyres on a moving car. I&#x27;ve decided to create a new version of the framework from scratch so that we can migrate our existing models across at our lesiure.<p>So yeah, cool, time to cast aside the chains of past implementations and stride into the bright shining future of version 2.0 where we get it right this time &#x2F;s.<p><i>QUESTION</i><p>Is there a methodology, process or set of principles that I can use to help me design the new API for the next version of my framework? How do you go about improving &#x2F; redesigning a framework API? Are there any resources that you recommend? Do you have any advice or guidance?<p>I have a good understanding of the features I need and how to implement them internally, it&#x27;s the API design that I&#x27;m unsure of.

1 comment

osdotsystem超过 4 年前
Some basics: don&#x27;t: &#x2F;get&#x2F;articles&#x2F; . do: &#x2F;articles. don&#x27;t: &#x2F;articles&#x2F;all . do: &#x2F;articles. &#x2F;article&#x2F;&lt;id&gt; and so on
评论 #25204697 未加载