This is jqMVC# - Definition & Summary

Before discussing more, please realize what I’m talking about is not “theoretical research”, but “real successful practice”.

Definition

I created the word – “jqMVC#”, which means bunch of things:

  • “j”  means it is about JavaScript;
  • “q” means it is about jQuery & jQuery plugins;
  • “MVC” means it is about MVC pattern;
  • “#” means it is about C#;
  • “j”+”#” means it is about Script#;

Another thing which is not directly represented by the word but implied is TDD in JavaScript but whose code is written in C#.

When all these things come together, it is jqMVC# – a new practical architecture which makes enterprise-level HTML & JavaScript only rich UI development in B/S-architecture application become not only possible, but also as a representative of HTML5 with which we could really say ‘Good bye!’ to Flash & Silverlight even now.

Summary

In this summary, I’m trying to talk a little bit more for each of the items I mentioned in previous section to make this architecture look more conceivable.

Firstly, our JavaScript code is written in C# with the help of Script#. Script# could compile C# source code to JavaScript automatically. The biggest benefit here is, even a junior developer who is familiar with C# but only know a little of JavaScript could write huge OO JavaScript code efficiently.

Secondly, the M, V, C classes implementing the MVC pattern in client-side JavaScript are written in C# and are compiled into JavaScript through Script# automatically.

Why MVC?

Two main benefits:

1. Separations of data, controlling and presentation;

2. Easier for unit testing;

In JavaScript, when we implementing MVC pattern,

  • Models are JSON comes from server-side services through AJAX and JSONP communication, which should be under TDD in server-side coding;
  • Controllers are Script# classes focus on the controlling of Models and Views, which should be under TDD in Script# coding;
  • Views are as connectors between pure HTML & JavaScript code and Script# based Models & Controllers code, which should also be under TDD in Script# coding;

Thirdly, jQuery & jQuery plugins are wrapped by Script# together with the Script# predefined libraries as the main tool libraries for client side UI rendering & controlling. Especially, jTemplate is used as the main HTML rendering engine. QUnit is also wrapped by Script# and used as the client-side testing library to implement client-side regression testing which is the core of client-side TDD.

To be continued…

In next post, I’m going to give a simple but runable example and try to convince you why I’m saying “It is time to say ‘Good bye!’ to Flash & Silverlight in RIA” when we are applying jqMVC# architecture.

docker build -t ash-master . [+] Building 43.0s (6/8) docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 377B 0.0s => [internal] load metadata for docker.io/library/centos:7 17.9s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => CACHED [1/4] FROM docker.io/library/centos:7@sha256:be65f488b7764ad3638f23 0.0s => [internal] load build context 0.0s => => transferring context: 4.07kB 0.0s => ERROR [2/4] RUN yum update -y &amp;&amp; yum install -y epel-release &amp;&amp; y 25.1s ------ > [2/4] RUN yum update -y &amp;&amp; yum install -y epel-release &amp;&amp; yum install -y git tor python3: 0.990 Loaded plugins: fastestmirror, ovl 1.408 Determining fastest mirrors 25.05 Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&amp;arch=x86_64&amp;repo=os&amp;infra=container error was 25.05 14: curl#7 - "Failed connect to mirrorlist.centos.org:80; Operation now in progress" 25.05 25.05 25.05 One of the configured repositories failed (Unknown), 25.05 and yum doesn't have enough cached data to continue. At this point the only 25.05 safe thing yum can do is fail. There are a few ways to work "fix" this: 25.05 25.05 1. Contact the upstream for the repository and get them to fix the problem. 25.05 25.05 2. Reconfigure the baseurl/etc. for the repository, to point to a working 25.05 upstream. This is most often useful if you are using a newer 25.05 distribution release than is supported by the repository (and the 25.05 packages for the previous distribution release still work). 25.05 25.05 3. Run the command with the repository temporarily disabled 25.05 yum --disablerepo=<repoid> ... 25.05 25.05 4. Disable the repository permanently, so yum won't use it by default. Yum 25.05 will then just ignore the repository until you permanently enable it 25.05 again or use --enablerepo for temporary usage: 25.05 25.05 yum-config-manager --disable <repoid> 25.05 or 25.05 subscription-manager repos --disable=<repoid> 25.05 25.05 5. Configure the failing repository to be skipped, if it is unavailable. 25.05 Note that yum will try to contact the repo. when it runs most commands, 25.05 so will have to try and fail each time (and thus. yum will be be much 25.05 slower). If it is a very temporary problem though, this is often a nice 25.05 compromise: 25.05 25.05 yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true 25.05 25.05 Cannot find a valid baseurl for repo: base/7/x86_64 ------ Dockerfile:5 -------------------- 4 | # 安装依赖包 5 | >>> RUN yum update -y &amp;&amp; \ 6 | >>> yum install -y epel-release &amp;&amp; \ 7 | >>> yum install -y git tor python3 8 | -------------------- ERROR: failed to solve: process "/bin/sh -c yum update -y &amp;&amp; yum install -y epel-release &amp;&amp; yum install -y git tor python3" did not complete successfully: exit code: 1 编译的时候报错了,怎么解决
最新发布
07-05
从您提供的日志来看,在执行`yum update -y &amp;&amp; yum install -y epel-release &amp;&amp; yum install -y git tor python3`这一步时发生了错误,原因是无法访问`mirrorlist.centos.org`以获取镜像列表。这种问题通常是由于网络连接问题或镜像源不可用导致的。 为了修复这个问题,您可以尝试以下几种方法之一: ### 方法1: 更换国内镜像源 将默认的CentOS镜像源替换为国内可用的速度较快的镜像源,例如阿里云、清华大学等提供的镜像源。以下是使用阿里云镜像源的例子: #### 修改后的Dockerfile ```Dockerfile # 使用官方的CentOS7镜像作为基础镜像 FROM centos:7 # 更换为阿里云yum源 RUN sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/CentOS-Base.repo &amp;&amp; \ sed -i 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.aliyun.com|g' /etc/yum.repos.d/CentOS-Base.repo # 安装依赖包 RUN yum clean all &amp;&amp; \ yum makecache &amp;&amp; \ yum install -y epel-release &amp;&amp; \ yum install -y git tor python3 # 设置工作目录 WORKDIR /app # 将主机当前目录下所有文件复制到容器的/app目录 COPY . . # 指定入口点 ENTRYPOINT ["python3", "ash"] ``` ### 方法2: 使用Docker Build Args 如果您只是临时解决问题或者想要更灵活地切换镜像源,可以考虑使用Docker的build参数来动态指定镜像源。 #### 修改后的Dockerfile ```Dockerfile # 使用官方的CentOS7镜像作为基础镜像 FROM centos:7 ARG MIRROR # 根据传入的参数选择镜像源 RUN if [ -n "${MIRROR}" ]; then \ sed -i "s|^mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-Base.repo &amp;&amp; \ sed -i "s|^#baseurl=http://mirror.centos.org|baseurl=${MIRROR}|g" /etc/yum.repos.d/CentOS-Base.repo; \ fi # 安装依赖包 RUN yum clean all &amp;&amp; \ yum makecache &amp;&amp; \ yum install -y epel-release &amp;&amp; \ yum install -y git tor python3 # 设置工作目录 WORKDIR /app # 将主机当前目录下所有文件复制到容器的/app目录 COPY . . # 指定入口点 ENTRYPOINT ["python3", "ash"] ``` #### 构建命令 在构建镜像时传递镜像源地址作为参数: ```bash docker build --build-arg MIRROR=https://mirrors.aliyun.com -t ash-master . ``` ### 方法3: 直接指定镜像源URL 如果您不想修改Dockerfile,也可以直接在构建命令中通过环境变量指定镜像源URL: ```bash docker build --build-arg MIRROR=https://mirrors.aliyun.com -t ash-master . \ --build-arg CENTOS_MIRROR=https://mirrors.aliyun.com/centos/ ``` 同时在Dockerfile中添加如下代码来处理这些环境变量: ```Dockerfile FROM centos:7 ARG MIRROR ARG CENTOS_MIRROR RUN if [ ! -z ${CENTOS_MIRROR} ]; then \ sed -i "s|http://mirror.centos.org|${CENTOS_MIRROR}|g" /etc/yum.repos.d/CentOS-Base.repo; \ fi RUN yum clean all &amp;&amp; \ yum makecache &amp;&amp; \ yum install -y epel-release &amp;&amp; \ yum install -y git tor python3 WORKDIR /app COPY . . ENTRYPOINT ["python3", "ash"] ``` 选择其中任意一种方法都应该可以帮助您绕过由于网络原因造成的镜像源无法访问的问题。希望这对您有所帮助! ### 知识点 1. **Dockerfile优化**:通过调整镜像源加速Docker镜像构建过程。 - 修改镜像源可显著提高依赖下载速度,特别是对于中国用户而言。 2. **YUM源配置**:了解如何更改yum源以适应不同的网络环境。 - 更换为国内镜像源能有效避免因国际网络波动带来的构建失败问题。 3. **Docker Build Args**:利用构建参数传递变量值,增加灵活性。 - 可以在构建过程中动态地改变某些配置而不必修改Dockerfile本身。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值