主頁 > 軟體設計 > 文本操縱器:字串位置移動

文本操縱器:字串位置移動

2022-02-20 19:50:50 軟體設計

任務是構建一個文本操縱器:一個模擬一組文本操作命令的程式。給定一段輸入文本和一串命令,輸出變異的輸入文本和游標位置。

開始簡單:

命令

 h: move cursor one character to the left
 l: move cursor one character to the right
 r<c>: replace character under cursor with <c>

重復命令

# All commands can be repeated N times by prefixing them with a number.
# 
# [N]h: move cursor N characters to the left
# [N]l: move cursor N characters to the right
# [N]r<c>: replace N characters, starting from the cursor, with <c> and move the cursor

例子

# We'll use Hello World as our input text for all cases:
# 
#  Input: hhlhllhlhhll
# Output: Hello World
#           _
#           2
# 
#  Input: rhllllllrw
# Output: hello world
#               _
#               6
# 
#  Input: rh6l9l4hrw
# Output: hello world
#               _
#               6
# 
#  Input: 9lrL7h2rL
# Output: HeLLo WorLd
#            _
#            3
# 
#  Input: 999999999999999999999999999lr0
# Output: Hello Worl0
#                   _
#                  10
# 
#  Input: 999rsom
# Output: sssssssssss
#                   _
#                  10

我撰寫了以下代碼,但出現錯誤:

class Editor():
    def __init__(self, text):
        self.text = text
        self.pos = 0

    def f(self, step):
        self.pos  = int(step)

    def b(self, step):
        self.pos -= int(step)

    def r(self, char):
        s = list(self.text)
        s[self.pos] = char
        self.text = ''.join(s)

    def run(self, command):
        command = list(command)
        # if command not in ('F','B', 'R'):
        #
        while command:
            operation = command.pop(0).lower()
            if operation not in ('f','b','r'):
                raise ValueError('command not recognized.')
            method = getattr(self, operation)
            arg = command.pop(0)
            method(arg)

    def __str__(self):
        return self.text

# Normal run
text = 'abcdefghijklmn'
command = 'F2B1F5Rw'

ed = Editor(text)
ed.run(command)
print(ed)

我在我的代碼中使用了“F”和“B”而不是“h”和“l”,但問題是我缺少一個允許我定義可選“N”的部分。我的代碼只有在操作后定義了一個數字時才有效。如何修復上面的代碼以滿足所有要求?

uj5u.com熱心網友回復:

這個問題的關鍵是弄清楚如何決議命令字串。根據您的描述,命令字串包含一個可選數字,后跟以下三種可能性之一:

  • h
  • l
  • r, 后跟一個字符

決議這個的正則運算式是(在線嘗試):

(\d*)(h|l|r.)

Explanation:

(\d*)            Capture zero or more digits, 
     (h|l|r.)    Capture either an h, or an l, or an r followed by any character 

使用re.findall()此正則運算式,您可以獲得匹配串列,其中每個匹配都tuple包含捕獲的組。例如,"rh6l9l4hrw"給出結果

[('', 'rh'), ('6', 'l'), ('9', 'l'), ('4', 'h'), ('', 'rw')]

所以元組的第一個元素是一個字串表示N(如果不存在,則為空字串),元組的第二個元素是命令。如果命令是r,它將在其后包含替換字符。現在我們需要做的就是遍歷這個串列,并應用正確的命令。

我做了一些改變:

  1. self.pos通過具有處理正確邊界檢查的設定器的屬性進行訪問
  2. 在創建物件時將輸入文本分解為串列,因為無法像使用串列那樣就地修改字串。__str__()將串列連接回字串。
  3. self.text通過只讀屬性訪問,該屬性將self.__text串列連接成字串。
class Editor():
    def __init__(self, text):
        self.__text = [char for char in text]
        self.__pos = 0
    
    @property
    def text(self):
        return "".join(self.__text)
    
    @property
    def pos(self):
        return self.__pos
    
    @pos.setter
    def pos(self, value):
        self.__pos = max(0, min(len(self.text)-1, value))

    def l(self, step):
        self.pos = self.pos   step

    def h(self, step):
        self.pos = self.pos - step

    def r(self, char, count=1):
        # If count causes the cursor to overshoot the text, 
        # modify count
        count = min(count, len(self.__text) - self.pos)
        self.__text[self.pos:self.pos count] = char * count
        self.pos = self.pos   count - 1 # Set position to last replaced character

    def run(self, command):
        commands = re.findall(r"(\d*)(h|l|r.)", command)
        
        for cmd in commands:
            self.validate(cmd)
            count = int(cmd[0] or "1") # If cmd[0] is blank, use count = 1
            if cmd[1] == "h":
                self.h(count)
            elif cmd[1] == "l":
                self.l(count)
            elif cmd[1][0] == "r":
                self.r(cmd[1][1], count)

    def validate(self, cmd):
        cmd_s = ''.join(cmd)
        if cmd[0] and not cmd[0].isnumeric():
            raise ValueError(f"Invalid numeric input {cmd[0]} for command {cmd_s}")
        elif cmd[1][0] not in "hlr":
            raise ValueError(f"Invalid command {cmd_s}: Must be either h or l or r")
        elif cmd[1] == 'r' and len(cmd) == 1:
            raise ValueError(f"Invalid command {cmd_s}: r command needs an argument")

    def __str__(self):
        return self.text

使用給定的輸入運行它:

commands = ["hhlhllhlhhll", "rhllllllrw", "rh6l9l4hrw", "9lrL7h2rL", "999999999999999999999999999lr0", "999rsom"]

for cmd in commands:
    e = Editor("Hello World")
    e.run(cmd)
    uline = "        "   " " * e.pos   "^"
    cline = "Cursor: "   " " * e.pos   str(e.pos)
    print(f"Input: {cmd}\nOutput: {str(e)}\n{uline}\n{cline}\n")
Input: hhlhllhlhhll
Output: Hello World
          ^
Cursor:   2

Input: rhllllllrw
Output: hello world
              ^
Cursor:       6

Input: rh6l9l4hrw
Output: hello world
              ^
Cursor:       6

Input: 9lrL7h2rL
Output: HeLLo WorLd
           ^
Cursor:    3

Input: 999999999999999999999999999lr0
Output: Hello Worl0
                  ^
Cursor:           10

Input: 999rsom
Output: sssssssssss
                  ^
Cursor:           10

現在,如果你想在沒有正則運算式的情況下做同樣的事情,你只需要想辦法將輸入命令字串決議成那種元組串列,你可以使用與以前相同的邏輯來進行實際替換。

在這里,我將通過撰寫一個函式來實作這一點,該函式接受一個字串,并回傳一個遍歷其中所有命令的迭代器。產生的每個元素都是一個元組,看起來像回傳的串列中的一個元素re.findall()這將允許我們re.findall()用我們的自定義決議器簡單地替換呼叫:

    def iter_command(self, command: str):
        cmd = [[], []]
        # The command is made of two segments: 
        # 1. The number part
        # 2. The letters "h|l|r." part of the regex
        seg = 0 # Start with the first segment
        for cpos, char in enumerate(command):
            if seg == 0:
                if "0" <= char <= "9":
                    # If the character is a number, append it to the first segment
                    cmd[seg].append(char)
                elif char in "hlr":
                    # Else, if the character is h or l or r, move on to the next segment
                    seg = 1
                    
            if seg == 1:
                if not cmd[seg] and char in "hlr":
                    # If this segment is empty and the character is h|l|r
                    cmd[seg] = [char] 
                    if char != "r":
                        # Convert our list of lists of characters to a tuple of strings and yield it
                        yield tuple(''.join(l) for l in cmd)
                        # Then reset cmd and seg to process the next command
                        cmd = [[], []]
                        seg = 0
                    else: # char == r
                        pass # So do one more iteration
                elif cmd[seg] and cmd[seg][-1] == "r": # Command is r, so listening for any character
                    cmd[seg].append(char)
                    # Same yield tasks as before
                    yield tuple(''.join(l) for l in cmd)
                    cmd = [[], []]
                    seg = 0
                else: # This is a character we don't care about
                # So do nothing with it
                    if any(cmd):
                        yield tuple(''.join(l) for l in cmd)
                    cmd = [[], []]
                    seg = 0

現在,讓我們針對之前的正則運算式進行測驗:

commands = ["hhlhllhlhhll", "rhllllllrw", "rh6l9l4hrw", "9lrL7h2rL", "999999999999999999999999999lr0", "999rsom"]

for cmd in commands:
    e = Editor("Hello World")
    commands_custom = list(e.iter_command(cmd))
    commands_regex = re.findall(r"(\d*)(h|l|r.)", cmd)
    
    print(commands_custom)
    print(commands_regex)
    print(cmd)
    print(all(a == b for a, b in zip(commands_custom, commands_regex)))
    print("")
[('', 'h'), ('', 'h'), ('', 'l'), ('', 'h'), ('', 'l'), ('', 'l'), ('', 'h'), ('', 'l'), ('', 'h'), ('', 'h'), ('', 'l'), ('', 'l')]
[('', 'h'), ('', 'h'), ('', 'l'), ('', 'h'), ('', 'l'), ('', 'l'), ('', 'h'), ('', 'l'), ('', 'h'), ('', 'h'), ('', 'l'), ('', 'l')]
hhlhllhlhhll
True

[('', 'rh'), ('', 'l'), ('', 'l'), ('', 'l'), ('', 'l'), ('', 'l'), ('', 'l'), ('', 'rw')]
[('', 'rh'), ('', 'l'), ('', 'l'), ('', 'l'), ('', 'l'), ('', 'l'), ('', 'l'), ('', 'rw')]
rhllllllrw
True

[('', 'rh'), ('6', 'l'), ('9', 'l'), ('4', 'h'), ('', 'rw')]
[('', 'rh'), ('6', 'l'), ('9', 'l'), ('4', 'h'), ('', 'rw')]
rh6l9l4hrw
True

[('9', 'l'), ('', 'rL'), ('7', 'h'), ('2', 'rL')]
[('9', 'l'), ('', 'rL'), ('7', 'h'), ('2', 'rL')]
9lrL7h2rL
True

[('999999999999999999999999999', 'l'), ('', 'r0')]
[('999999999999999999999999999', 'l'), ('', 'r0')]
999999999999999999999999999lr0
True

[('999', 'rs')]
[('999', 'rs')]
999rsom
True

而且,由于這些給出相同的結果,我們只需要將呼叫替換為re.findall()

    def run(self, command):
-        commands = re.findall(r"(\d*)(h|l|r.)", command)
         commands = self.iter_command(command)

        for cmd in commands:

uj5u.com熱心網友回復:

@paddy 給了你一個很好的建議,但是看看你需要決議的字串,在我看來,正則運算式可以很容易地完成這項作業。對于決議后的部分,命令模式非常適合。畢竟,您有一個必須在初始字串上執行的操作(命令)串列。

在您的情況下,我認為使用這種模式主要帶來 3 個優勢:

  • 每個Command代表應用于初始字串的操作。這也意味著,例如,如果您想為一系列操作添加快捷方式,則 finalCommand的數量保持不變,您只需調整決議步驟。另一個好處是您可以擁有命令歷史記錄,并且通常設計更加靈活。

  • 所有Command的 s 共享一個公共介面:一個方法execute(),如果需要,一個方法unexecute()用于撤消該execute()方法應用的更改。

  • Commands 將操作執行與決議問題分離。


至于實作,首先定義Commands,它不包含任何業務邏輯,除了對接收者方法的呼叫。

from __future__ import annotations
import functools
import re
import abc
from typing import Iterable

class ICommand(abc.ABC):
    @abc.abstractmethod
    def __init__(self, target: TextManipulator):
        self._target = target

    @abc.abstractmethod
    def execute(self):
        pass

class MoveCursorLeftCommand(ICommand):
    def __init__(self, target: TextManipulator, counter):
        super().__init__(target)
        self._counter = counter

    def execute(self):
        self._target.move_cursor_left(self._counter)

class MoveCursorRightCommand(ICommand):
    def __init__(self, target: TextManipulator, counter):
        super().__init__(target)
        self._counter = counter

    def execute(self):
        self._target.move_cursor_right(self._counter)

class ReplaceCommand(ICommand):
    def __init__(self, target: TextManipulator, counter, replacement):
        super().__init__(target)
        self._replacement = replacement
        self._counter = counter

    def execute(self):
        self._target.replace_char(self._counter, self._replacement)

然后你就有了命令的接收者,它TextManipulator包含了改變文本和游標位置的方法。

class TextManipulator:
    """
    >>> def apply_commands(s, commands_str): 
    ...     return TextManipulator(s).run_commands(CommandParser.parse(commands_str))
    >>> apply_commands('Hello World', 'hhlhllhlhhll')
    ('Hello World', 2)
    >>> apply_commands('Hello World', 'rhllllllrw')
    ('hello world', 6)
    >>> apply_commands('Hello World', 'rh6l9l4hrw')
    ('hello world', 6)
    >>> apply_commands('Hello World', '9lrL7h2rL')
    ('HeLLo WorLd', 3)
    >>> apply_commands('Hello World', '999999999999999999999999999lr0')
    ('Hello Worl0', 10)
    >>> apply_commands('Hello World', '999rsom')
    Traceback (most recent call last):
    ValueError: command 'o' not recognized.
    >>> apply_commands('Hello World', '7l5r1')
    ('Hello W1111', 10)
    >>> apply_commands('Hello World', '7l4r1')
    ('Hello W1111', 10)
    >>> apply_commands('Hello World', '7l3r1')
    ('Hello W111d', 9)
    """
    def __init__(self, text):
        self._text = text
        self._cursor_pos = 0

    def replace_char(self, counter, replacement):
        assert len(replacement) == 1
        assert counter >= 0
        self._text = self._text[0:self._cursor_pos]   \
            replacement * min(counter, len(self._text) - self._cursor_pos)   \
            self._text[self._cursor_pos   counter:]

        self.move_cursor_right(counter - 1)

    def move_cursor_left(self, counter):
        assert counter >= 0
        self._cursor_pos = max(0, self._cursor_pos - counter)

    def move_cursor_right(self, counter):
        assert counter >= 0
        self._cursor_pos = min(len(self._text) - 1, self._cursor_pos   counter)

    def run_commands(self, commands: Iterable[ICommand]):
        for cmd in map(lambda partial_cmd: partial_cmd(target=self), commands):
            cmd.execute()

        return (self._text, self._cursor_pos)

run_commands除了接受部分命令的可迭代的方法之外,沒有什么很難解釋這段代碼。這些部分命令是在沒有接收器物件的情況下啟動的命令,其型別應為TextManipulator. 你為什么要這樣做?這是一種將決議與命令執行分離的可能方法。我決定這樣做,functools.partial但你還有其他有效的選擇。


最終,決議部分:

class CommandParser:
    @staticmethod
    def parse(commands_str: str):
        def invalid_command(match: re.Match):
            raise ValueError(f"command '{match.group(2)}' not recognized.")

        get_counter_from_match = lambda m: int(m.group(1) or 1)
        commands_map = { 
            'h': lambda match: functools.partial(MoveCursorLeftCommand, \
                counter=get_counter_from_match(match)), 
            'l': lambda match: functools.partial(MoveCursorRightCommand, \
                counter=get_counter_from_match(match)), 
            'r': lambda match: functools.partial(ReplaceCommand, \
                counter=get_counter_from_match(match), replacement=match.group(3))
        }
        parsed_commands_iter = re.finditer(r'(\d*)(h|l|r(\w)|.)', commands_str)
        commands = map(lambda match: \
            commands_map.get(match.group(2)[0], invalid_command)(match), parsed_commands_iter)
        
        return commands

if __name__ == '__main__':
    import doctest
    doctest.testmod()

正如我在開始時所說,在您的情況下可以使用正則運算式進行決議,并且命令創建基于每個匹配項的第二個捕獲組的第一個字母。原因是對于 char 替換,第二個捕獲組也包含要替換的 char。使用as 鍵commands_map訪問match.group(2)[0]并回傳 partial Command如果在 map 中找不到該操作,則會引發ValueError例外。每個引數都是從物件Command中推斷出來的。re.Match


只需將所有這些代碼片段放在一起,您就有了一個可行的解決方案(以及由 執行的檔案字串提供的一些測驗doctest)。

在某些情況下,這可能是一個過于復雜的設計,所以我并不是說這是正確的方法(例如,如果您正在撰寫一個簡單的工具,則可能不是)。您可以避免Commands 部分而只采用決議解決方案,但我發現這是該模式的一個有趣(替代)應用程式。

轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/429038.html

標籤:Python python-3.x 算法 哎呀 数据结构

上一篇:回呼轉換并從另一個物件設定

下一篇:如何在另一個類中宣告與一個類相關的物件?

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 面試突擊第一季,第二季,第三季

    第一季必考 https://www.bilibili.com/video/BV1FE411y79Y?from=search&seid=15921726601957489746 第二季分布式 https://www.bilibili.com/video/BV13f4y127ee/?spm_id_fro ......

    uj5u.com 2020-09-10 05:35:24 more
  • 第三單元作業總結

    1.前言 這應該是本學期最后一次寫作業總結了吧。總體來說,對作業的節奏也差不多掌握了,作業做起來的效率也更高了。雖然和之前的作業一樣,作業中都要用到新的知識,但是相比之前,更加懂得了如何利用工具以及資料。雖然之間卡過殼,但總體而言,這幾次作業還算完成的比較好。 2.作業程序總結 相比前兩個單元,此單 ......

    uj5u.com 2020-09-10 05:35:41 more
  • 北航OO(2020)第四單元博客作業暨課程總結博客

    北航OO(2020)第四單元博客作業暨課程總結博客 本單元作業的架構設計 在本單元中,由于UML圖具有比較清晰的樹形結構,因此我對其中需要進行查詢操作的元素進行了包裝,在樹的父節點中存盤所有孩子的參考。考慮到性能問題,我采用了快取機制,一次查詢后盡可能快取已經遍歷過的資訊,以減少遍歷次數。 本單元我 ......

    uj5u.com 2020-09-10 05:35:48 more
  • BUAA_OO_第四單元

    一、UML決議器設計 ? 先看下題目:第四單元實作一個基于JDK 8帶有效性檢查的UML(Unified Modeling Language)類圖,順序圖,狀態圖分析器 MyUmlInteraction,實際上我們要建立一個有向圖模型,UML中的物件(元素)可能與同級元素連接,也可與低級元素相連形成 ......

    uj5u.com 2020-09-10 05:35:54 more
  • 6.1邏輯運算子

    邏輯運算子 1. && 短路與 運算式1 && 運算式2 01.運算式1為true并且運算式2也為true 整體回傳為true 02.運算式1為false,將不會執行運算式2 整體回傳為false 03.只要有一個運算式為false 整體回傳為false 2. || 短路或 運算式1 || 運算式2 ......

    uj5u.com 2020-09-10 05:35:56 more
  • BUAAOO 第四單元 & 課程總結

    1. 第四單元:StarUml檔案決議 本單元采用了圖模型決議UML。 UML檔案可以抽象為圖、子圖、邊的邏輯結構。 在實作中,圖的節點包括類、介面、屬性,子圖包括狀態圖、順序圖等。 采用了三次遍歷UML元素的方法建圖,第一遍遍歷建點,第二、三次遍歷設定屬性、連邊,實作圖物件的初始化。這里借鑒了一些 ......

    uj5u.com 2020-09-10 05:36:06 more
  • 談談我對C# 多型的理解

    面向物件三要素:封裝、繼承、多型。 封裝和繼承,這兩個比較好理解,但要理解多型的話,可就稍微有點難度了。今天,我們就來講講多型的理解。 我們應該經常會看到面試題目:請談談對多型的理解。 其實呢,多型非常簡單,就一句話:呼叫同一種方法產生了不同的結果。 具體實作方式有三種。 一、多載 多載很簡單。 p ......

    uj5u.com 2020-09-10 05:36:09 more
  • Python 資料驅動工具:DDT

    背景 python 的unittest 沒有自帶資料驅動功能。 所以如果使用unittest,同時又想使用資料驅動,那么就可以使用DDT來完成。 DDT是 “Data-Driven Tests”的縮寫。 資料:http://ddt.readthedocs.io/en/latest/ 使用方法 dd. ......

    uj5u.com 2020-09-10 05:36:13 more
  • Python里面的xlrd模塊詳解

    那我就一下面積個問題對xlrd模塊進行學習一下: 1.什么是xlrd模塊? 2.為什么使用xlrd模塊? 3.怎樣使用xlrd模塊? 1.什么是xlrd模塊? ?python操作excel主要用到xlrd和xlwt這兩個庫,即xlrd是讀excel,xlwt是寫excel的庫。 今天就先來說一下xl ......

    uj5u.com 2020-09-10 05:36:28 more
  • 當我們創建HashMap時,底層到底做了什么?

    jdk1.7中的底層實作程序(底層基于陣列+鏈表) 在我們new HashMap()時,底層創建了默認長度為16的一維陣列Entry[ ] table。當我們呼叫map.put(key1,value1)方法向HashMap里添加資料的時候: 首先,呼叫key1所在類的hashCode()計算key1 ......

    uj5u.com 2020-09-10 05:36:38 more
最新发布
  • 【中介者設計模式詳解】C/Java/JS/Go/Python/TS不同語言實作

    * 中介者模式是一種行為型設計模式,它可以用來減少類之間的直接依賴關系,
    * 將物件之間的通信封裝到一個中介者物件中,從而使得各個物件之間的關系更加松散。
    * 在中介者模式中,物件之間不再直接相互互動,而是通過中介者來中轉訊息。 ......

    uj5u.com 2023-04-20 08:20:47 more
  • 露天煤礦現場調研和交流案例分享

    他們集團的資訊化公司及研究院在一個礦區正在做智能礦山的統一平臺的 試點,專案投資大概1億,包括了礦山的各方面的內容,顯示得我們這次交流有點多余。他們2年前開始做智能礦山的規劃,有很多煤礦行業專家的加持,他們的描述是非常完美,但是去年底應該上線的平臺,現在還沒有看到影子。他們確實有很多場景需求,但是被... ......

    uj5u.com 2023-04-20 08:20:25 more
  • 《社區人員管理》實戰案例設計&個人案例分享

    設計是一個讓人夢想成真程序,開始編碼、測驗、除錯之前進行需求分析和架構設計,才能保證關鍵方面都做正確 ......

    uj5u.com 2023-04-20 08:20:17 more
  • 軟體架構生態化-多角色交付的探索實踐

    作為一個技術架構師,不僅僅要緊跟行業技術趨勢,還要結合研發團隊現狀及痛點,探索新的交付方案。在日常中,你是否遇到如下問題 “ 業務需求排期長研發是瓶頸;非研發角色感受不到研發技改提效的變化;引入ISV 團隊又擔心質量和安全,培訓周期長“等等,基于此我們探索了一種新的技術體系及交付方案來解決如上問題。 ......

    uj5u.com 2023-04-20 08:20:10 more
  • 【中介者設計模式詳解】C/Java/JS/Go/Python/TS不同語言實作

    * 中介者模式是一種行為型設計模式,它可以用來減少類之間的直接依賴關系,
    * 將物件之間的通信封裝到一個中介者物件中,從而使得各個物件之間的關系更加松散。
    * 在中介者模式中,物件之間不再直接相互互動,而是通過中介者來中轉訊息。 ......

    uj5u.com 2023-04-20 08:19:44 more
  • 露天煤礦現場調研和交流案例分享

    他們集團的資訊化公司及研究院在一個礦區正在做智能礦山的統一平臺的 試點,專案投資大概1億,包括了礦山的各方面的內容,顯示得我們這次交流有點多余。他們2年前開始做智能礦山的規劃,有很多煤礦行業專家的加持,他們的描述是非常完美,但是去年底應該上線的平臺,現在還沒有看到影子。他們確實有很多場景需求,但是被... ......

    uj5u.com 2023-04-20 08:19:07 more
  • 《社區人員管理》實戰案例設計&個人案例分享

    設計是一個讓人夢想成真程序,開始編碼、測驗、除錯之前進行需求分析和架構設計,才能保證關鍵方面都做正確 ......

    uj5u.com 2023-04-20 08:18:57 more
  • 軟體架構生態化-多角色交付的探索實踐

    作為一個技術架構師,不僅僅要緊跟行業技術趨勢,還要結合研發團隊現狀及痛點,探索新的交付方案。在日常中,你是否遇到如下問題 “ 業務需求排期長研發是瓶頸;非研發角色感受不到研發技改提效的變化;引入ISV 團隊又擔心質量和安全,培訓周期長“等等,基于此我們探索了一種新的技術體系及交付方案來解決如上問題。 ......

    uj5u.com 2023-04-20 08:18:49 more
  • 05單件模式

    #經典的單件模式 public class Singleton { private static Singleton uniqueInstance; //一個靜態變數持有Singleton類的唯一實體。 // 其他有用的實體變數寫在這里 //構造器宣告為私有,只有Singleton可以實體化這個類! ......

    uj5u.com 2023-04-19 08:42:51 more
  • 【架構與設計】常見微服務分層架構的區別和落地實踐

    軟體工程的方方面面都遵循一個最基本的道理:沒有銀彈,架構分層模型更是如此,每一種都有各自優缺點,所以請根據不同的業務場景,并遵循簡單、可演進這兩個重要的架構原則選擇合適的架構分層模型即可。 ......

    uj5u.com 2023-04-19 08:42:41 more